Struct sc_service::config::MultiaddrWithPeerId[][src]

pub struct MultiaddrWithPeerId {
    pub multiaddr: Multiaddr,
    pub peer_id: PeerId,
}

Address of a node, including its identity.

This struct represents a decoded version of a multiaddress that ends with /p2p/<peerid>.

Example

let addr: MultiaddrWithPeerId =
	"/ip4/198.51.100.19/tcp/30333/p2p/QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV".parse().unwrap();
assert_eq!(addr.peer_id.to_base58(), "QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV");
assert_eq!(addr.multiaddr.to_string(), "/ip4/198.51.100.19/tcp/30333");

Fields

multiaddr: Multiaddr

Address of the node.

peer_id: PeerId

Its identity.

Implementations

impl MultiaddrWithPeerId[src]

pub fn concat(&self) -> Multiaddr[src]

Concatenates the multiaddress and peer ID into one multiaddress containing both.

Trait Implementations

impl Clone for MultiaddrWithPeerId[src]

impl Debug for MultiaddrWithPeerId[src]

impl<'de> Deserialize<'de> for MultiaddrWithPeerId[src]

impl Display for MultiaddrWithPeerId[src]

impl FromStr for MultiaddrWithPeerId[src]

type Err = ParseErr

The associated error which can be returned from parsing.

impl Serialize for MultiaddrWithPeerId[src]

impl TryFrom<String> for MultiaddrWithPeerId[src]

type Error = ParseErr

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for MultiaddrWithPeerId

impl Send for MultiaddrWithPeerId

impl Sync for MultiaddrWithPeerId

impl Unpin for MultiaddrWithPeerId

impl UnwindSafe for MultiaddrWithPeerId

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> Erased for T[src]

impl<T> Error for T where
    T: 'static + Send + Debug + Display
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeDisplay for T where
    T: Display
[src]

impl<T> MaybeFromStr for T where
    T: FromStr
[src]

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe
[src]

impl<T> MaybeSerialize for T where
    T: Serialize
[src]

impl<T> MaybeSerializeDeserialize for T where
    T: DeserializeOwned + Serialize
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> SaturatedConversion for T[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]