[][src]Enum quic_p2p::Peer

pub enum Peer {
    Node {
        node_info: NodeInfo,
    },
    Client {
        peer_addr: SocketAddr,
    },
}

Representation of a peer to us.

Variants

Node

Fields of Node

node_info: NodeInfo
Client

Fields of Client

peer_addr: SocketAddr

Methods

impl Peer[src]

pub fn peer_addr(&self) -> SocketAddr[src]

Get peer's Endpoint

pub fn peer_cert_der(&self) -> Option<&[u8]>[src]

Get peer's Certificate

If the peer was a node then the function returns the certificate used by it. For clients it is not useful in our network to share certificates as we don't reverse connect to the clients. Due to absence of the knowledge of client's certificate (as it's not exchanged in handshake) this function retuns None for client peers.

Trait Implementations

impl PartialEq<Peer> for Peer[src]

impl Clone for Peer[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Peer[src]

impl Into<Peer> for NodeInfo[src]

impl Debug for Peer[src]

impl Hash for Peer[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

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

impl Serialize for Peer[src]

Auto Trait Implementations

impl Send for Peer

impl Sync for Peer

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

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

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