pub struct AsyncWriteConverse<W: AsyncWrite + Unpin, T: Serialize + DeserializeOwned + Unpin> { /* private fields */ }
Expand description

Used to send messages to the connected peer. You may optionally receive replies to your messages as well.

You must drive the corresponding AsyncReadConverse in order to receive replies to your messages. You can do this either by driving the Stream implementation, or calling AsyncReadConverse::drive_forever.

Implementations§

Send a message, and wait for a reply, with the default timeout. Shorthand for .awaiting both layers of .send(message).

Send a message, and wait for a reply, up to timeout. Shorthand for .awaiting both layers of .send_timeout(message).

Sends a message to the peer on the other side of the connection. This returns a future wrapped in a future. You must .await the first layer to send the message, however .awaiting the second layer is optional. You only need to .await the second layer if you care about the reply to your message. Waits up to the default timeout for a reply.

Sends a message to the peer on the other side of the connection, waiting up to the specified timeout for a reply. This returns a future wrapped in a future. You must .await the first layer to send the message, however .awaiting the second layer is optional. You only need to .await the second layer if you care about the reply to your message.

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.

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.