Skip to main content

Event

Enum Event 

Source
pub enum Event {
    Accepted {
        key: u64,
        socket: Socket,
        peer: Option<SocketAddr>,
    },
    Data {
        key: u64,
        buf: Vec<u8>,
    },
    Eof {
        key: u64,
    },
    Error {
        key: u64,
        error: Error,
    },
    Sent {
        key: u64,
        buf: OutBuf,
    },
    Datagram {
        key: u64,
        buf: Vec<u8>,
        meta: RecvMeta,
    },
    Closed {
        key: u64,
    },
    Wake,
}
Expand description

Something that happened, reported by Driver::turn.

Variants§

§

Accepted

A listener accepted a connection. The socket is non-blocking and not yet registered.

Fields

§key: u64
§socket: Socket
§

Data

Bytes arrived on a stream: buf[..] holds them (buf.len() > 0).

Fields

§key: u64
§buf: Vec<u8>
§

Eof

The peer closed its sending side. Receiving stops; sending may continue.

Fields

§key: u64
§

Error

A receive, send or accept failed. The connection should be closed.

Fields

§key: u64
§error: Error
§

Sent

A buffer was written completely (or discarded because the connection failed or closed).

Fields

§key: u64
§

Datagram

A datagram (or a GRO batch) arrived on a UDP socket.

Fields

§key: u64
§buf: Vec<u8>
§

Closed

A socket given to Driver::close is closed and the driver holds nothing of it.

Fields

§key: u64
§

Wake

A Waker was triggered.

Trait Implementations§

Source§

impl Debug for Event

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Event

§

impl !UnwindSafe for Event

§

impl Forget for Event

§

impl Freeze for Event

§

impl Move for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

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

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

fn try_from(value: U) -> Result<T, !>

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.