[][src]Enum quic_p2p::Peer

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

Representation of a peer to us.



Stores Node information.

Fields of Node

node_info: NodeInfo

Information needed to connect to a node.


Stores client information.

Fields of Client

peer_addr: SocketAddr

Address of the client reaching us.


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

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 Unpin for Peer

impl Sync for Peer

impl Send for Peer

impl RefUnwindSafe for Peer

impl UnwindSafe for Peer

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T> Erased for T

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

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