Enum ServerEvent

Source
pub enum ServerEvent {
    Connection(ConnectionID),
    ConnectionLost(ConnectionID, bool),
    ConnectionClosed(ConnectionID, bool),
    Message(ConnectionID, Vec<u8>),
    ConnectionCongestionStateChanged(ConnectionID, bool),
    PacketLost(ConnectionID, Vec<u8>),
}
Expand description

Enum of server network events.

Variants§

§

Connection(ConnectionID)

Event emitted once a new client connection has been established.

§

ConnectionLost(ConnectionID, bool)

Event emitted when a existing client connection is lost.

The contained boolean indicates whether the connection was lost due to an isse the remote end, if the value is false instead, then a local issue caused the connection to be lost.

§

ConnectionClosed(ConnectionID, bool)

Event emitted when a client connection is closed programmatically.

The contained boolean indicates whether the connection was closed by the remote end, if the value is false instead, then the connection was closed locally.

§

Message(ConnectionID, Vec<u8>)

Event emitted for each message received from a client connection.

§

ConnectionCongestionStateChanged(ConnectionID, bool)

Event emitted each time a client’s connection congestion state changes.

§

PacketLost(ConnectionID, Vec<u8>)

Event emitted each time a client connection packet is lost.

Trait Implementations§

Source§

impl Debug for ServerEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ServerEvent

Source§

fn eq(&self, other: &ServerEvent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ServerEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.