pub enum Status {
    Connected,
    Disconnected(Box<dyn Any + Send + Sync>),
    Closed,
    Dropped(Error),
}
Expand description

An enum for the possible states of a connection.

Variants

Connected

The connection is still live.

Disconnected(Box<dyn Any + Send + Sync>)

The connection is closed because the peer disconnected by sending a disconnection message.

Closed

The connection is closed because we chose to close the connection.

Dropped(Error)

The connection was dropped without sending a disconnection message.

Implementations

Returns whether the status is Status::Connected.

Turns this into an option with the disconnect message.

Panics

Panics if the generic parameter D isn’t the disconnect message type (the same D that you passed into MsgTable::build).

Turns this into an option with the disconnect message.

Turns this into an option with the drop error.

Returns whether the status is Status::Closed.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.