Struct sc_network_types::multiaddr::Multiaddr
source · pub struct Multiaddr { /* private fields */ }
Expand description
Multiaddr
type used in Substrate. Converted to libp2p’s Multiaddr
or litep2p’s Multiaddr
when passed to the corresponding network backend.
Implementations§
source§impl Multiaddr
impl Multiaddr
sourcepub fn push(&mut self, p: Protocol<'_>)
pub fn push(&mut self, p: Protocol<'_>)
Adds an address component to the end of this multiaddr.
sourcepub fn pop<'a>(&mut self) -> Option<Protocol<'a>>
pub fn pop<'a>(&mut self) -> Option<Protocol<'a>>
Pops the last Protocol
of this multiaddr, or None
if the multiaddr is empty.
sourcepub fn with(self, p: Protocol<'_>) -> Self
pub fn with(self, p: Protocol<'_>) -> Self
Like Multiaddr::push
but consumes self
.
Trait Implementations§
source§impl Debug for Multiaddr
impl Debug for Multiaddr
Remove an extra layer of nestedness by deferring to the wrapped value’s Debug
.
source§impl From<Multiaddr> for Multiaddr
impl From<Multiaddr> for Multiaddr
source§fn from(multiaddr: LiteP2pMultiaddr) -> Self
fn from(multiaddr: LiteP2pMultiaddr) -> Self
Converts to this type from the input type.
source§impl From<Multiaddr> for Multiaddr
impl From<Multiaddr> for Multiaddr
source§fn from(multiaddr: LibP2pMultiaddr) -> Self
fn from(multiaddr: LibP2pMultiaddr) -> Self
Converts to this type from the input type.
source§impl<'a> FromIterator<Protocol<'a>> for Multiaddr
impl<'a> FromIterator<Protocol<'a>> for Multiaddr
source§impl<'a> IntoIterator for &'a Multiaddr
impl<'a> IntoIterator for &'a Multiaddr
source§impl Ord for Multiaddr
impl Ord for Multiaddr
source§impl PartialEq for Multiaddr
impl PartialEq for Multiaddr
source§impl PartialOrd for Multiaddr
impl PartialOrd for Multiaddr
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<Vec<u8>> for Multiaddr
impl TryFrom<Vec<u8>> for Multiaddr
§type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
impl Eq for Multiaddr
impl StructuralPartialEq for Multiaddr
Auto Trait Implementations§
impl Freeze for Multiaddr
impl RefUnwindSafe for Multiaddr
impl Send for Multiaddr
impl Sync for Multiaddr
impl Unpin for Multiaddr
impl UnwindSafe for Multiaddr
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)