mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-13 03:17:14 +00:00
13 lines
268 B
Rust
13 lines
268 B
Rust
|
use libp2p_core::multiaddr::Protocol;
|
||
|
use libp2p_core::Multiaddr;
|
||
|
|
||
|
pub(crate) trait MultiaddrExt {
|
||
|
fn is_relayed(&self) -> bool;
|
||
|
}
|
||
|
|
||
|
impl MultiaddrExt for Multiaddr {
|
||
|
fn is_relayed(&self) -> bool {
|
||
|
self.iter().any(|p| p == Protocol::P2pCircuit)
|
||
|
}
|
||
|
}
|