[][src]Enum harlequinn::EndpointEvent

pub enum EndpointEvent {
    ConnectionFailed {
        peer_id: PeerId,
    },
    ConnectionRequested {
        peer_id: PeerId,
        socket_addr: SocketAddr,
        is_client: bool,
    },
    Disconnected {
        peer_id: PeerId,
        reason: Option<String>,
    },
    ReceivedDatagram {
        peer_id: PeerId,
        bytes: Bytes,
    },
    ReceivedMessage {
        peer_id: PeerId,
        bytes: Bytes,
    },
}

An event raised on the endpoint.

Variants

ConnectionFailed

A connection initiated by this endpoint has failed.

Fields of ConnectionFailed

peer_id: PeerId

Associated peer id.

ConnectionRequested

A new connection has been requested by a peer.

You can use this to filter connections, limit player counts, etc. Either accept or reject a connection using RivetsEndpoint::accept and RivetsEndpoint::reject.

Fields of ConnectionRequested

peer_id: PeerId

Associated peer id.

socket_addr: SocketAddr

The socket address of the connecting peer.

is_client: bool

If true, the endpoint that has been connected to is a client.

Disconnected

An accepted connection got disconnected.

This will always be raised regardless of if the peer's request was accepted or not, because this could happen before the game loop gets to processing the request.

Fields of Disconnected

peer_id: PeerId

Associated peer id.

reason: Option<String>

An optional reason for the disconnection, None if the connection was closed by the local endpoint.

ReceivedDatagram

A datagram was received from a peer.

Fields of ReceivedDatagram

peer_id: PeerId

Associated peer id.

bytes: Bytes

Datagram data as bytes.

ReceivedMessage

A reliable message was received from a peer.

Fields of ReceivedMessage

peer_id: PeerId

Associated peer id.

bytes: Bytes

Message data as bytes.

Auto Trait Implementations

Blanket Implementations

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 = !

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,