pub struct Writer<W> {
    pub stream: W,
    pub sender: Sender,
}
Expand description

A writer that bundles a stream with a serializer to send the messages. This is used in the client’s .split() function as the writing component.

It can also be useful to use a websocket connection without a handshake.

Fields

stream: W

The stream that websocket messages will be written to

sender: Sender

The serializer that will be used to serialize the messages

Implementations

Sends a single data frame to the remote endpoint.

Sends a single message to the remote endpoint.

Closes the sender side of the connection, will cause all pending and future IO to return immediately with an appropriate value.

Shuts down both Sender and Receiver, will cause all pending and future IO to return immediately with an appropriate value.

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.

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.

Get the TypeId of this object.