Enum smoldot::libp2p::Event[][src]

pub enum Event<TConn> {
    Connected(PeerId),
    Disconnected {
        peer_id: PeerId,
        user_data: TConn,
        out_overlay_network_indices: Vec<usize>,
        in_overlay_network_indices: Vec<usize>,
    },
    RequestIn {
        id: ConnectionId,
        substream_id: SubstreamId,
        peer_id: PeerId,
        protocol_index: usize,
        request_payload: Vec<u8>,
    },
    NotificationsOutAccept {
        id: ConnectionId,
        peer_id: PeerId,
        overlay_network_index: usize,
        remote_handshake: Vec<u8>,
    },
    NotificationsOutReject {
        id: ConnectionId,
        peer_id: PeerId,
        overlay_network_index: usize,
    },
    NotificationsOutClose {
        id: ConnectionId,
        peer_id: PeerId,
        overlay_network_index: usize,
    },
    NotificationsInOpen {
        id: ConnectionId,
        overlay_network_index: usize,
        remote_handshake: Vec<u8>,
    },
    NotificationsIn {
        id: ConnectionId,
        peer_id: PeerId,
        has_symmetric_substream: bool,
        overlay_network_index: usize,
        notification: Vec<u8>,
    },
}

Event generated by Network::next_event.

Variants

Connected(PeerId)

Established a transport-level connection (e.g. a TCP socket) with the given peer.

Disconnected

A transport-level connection (e.g. a TCP socket) has been closed.

Fields of Disconnected

peer_id: PeerIduser_data: TConnout_overlay_network_indices: Vec<usize>in_overlay_network_indices: Vec<usize>
RequestIn

Received a request from a request-response protocol.

Fields of RequestIn

id: ConnectionIdsubstream_id: SubstreamId

Substream on which the request has been received. Must be passed back when providing the response.

peer_id: PeerIdprotocol_index: usizerequest_payload: Vec<u8>
NotificationsOutAccept

Fields of NotificationsOutAccept

id: ConnectionIdpeer_id: PeerIdoverlay_network_index: usizeremote_handshake: Vec<u8>
NotificationsOutReject

Fields of NotificationsOutReject

id: ConnectionIdpeer_id: PeerIdoverlay_network_index: usize
NotificationsOutClose

Fields of NotificationsOutClose

id: ConnectionIdpeer_id: PeerIdoverlay_network_index: usize
NotificationsInOpen

Fields of NotificationsInOpen

id: ConnectionIdoverlay_network_index: usizeremote_handshake: Vec<u8>
NotificationsIn

Fields of NotificationsIn

id: ConnectionIdpeer_id: PeerIdhas_symmetric_substream: bool

true if there exists an open outbound substream with this peer on the same overlay network.

overlay_network_index: usizenotification: Vec<u8>

Trait Implementations

impl<TConn: Debug> Debug for Event<TConn>[src]

Auto Trait Implementations

impl<TConn> RefUnwindSafe for Event<TConn> where
    TConn: RefUnwindSafe

impl<TConn> Send for Event<TConn> where
    TConn: Send

impl<TConn> Sync for Event<TConn> where
    TConn: Sync

impl<TConn> Unpin for Event<TConn> where
    TConn: Unpin

impl<TConn> UnwindSafe for Event<TConn> where
    TConn: UnwindSafe

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> Conv for T

impl<T> Conv for T

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> FmtForward for T

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

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

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

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<V, T> VZip<V> for T where
    V: MultiLane<T>,