pub struct AsyncWsFrameCodec<S: AsyncRead + AsyncWrite> {
    pub stream: S,
    pub read_state: FrameReadState,
    pub write_state: FrameWriteState,
}
Expand description

recv/send websocket frame

Fields

stream: S

underlying transport stream

read_state: FrameReadState

read state

write_state: FrameWriteState

write state

Implementations

construct method

construct with stream and config

get mutable underlying stream

used for server side to construct a new server

used to client side to construct a new client

receive a frame

send mutable payload

if mask_payload is set, mask payload first

will auto fragment if auto_fragment_size > 0

send immutable payload

will auto fragment if auto_fragment_size > 0

send a read frame, this method will not check validation of frame and do not fragment

split codec to recv and send parts

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more