Struct async_socket::State[][src]

pub struct State {
    pub buf: Vec<u8>,
    pub waker: Option<Waker>,
    pub chunk_size: usize,
}
Expand description

A central shared state of the socket where all socket data are stored.

Fields

buf: Vec<u8>

A buffer holding buffered bytes of the socket.

waker: Option<Waker>

The Waker reference of the root socket. The socket stores this reference to enable async notifications across cloned socket instances.

chunk_size: usize

The maximum size of a chunk returned by a stream.

Implementations

Returns a new instance with a specific chunk size.

Triggers the wake event if the waker has been set by the socket.

Trait Implementations

Returns the “default value” for a type. 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

Performs the conversion.

Performs the conversion.

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.