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

A message received from the connected peer, which you may choose to reply to.

Implementations§

Peeks at the message, panicking if the message had already been taken prior.

Peeks at the message, returning None if the message had already been taken prior.

Pulls the message from this, panicking if the message had already been taken prior.

Pulls the message from this, returning None if the message had already been taken prior.

Sends the given message as a reply to this one. There are two ways for the peer to receive this reply

  1. .await both layers of AsyncWriteConverse::send or AsyncWriteConverse::send_timeout
  2. They’ll receive it as the return value of AsyncWriteConverse::ask or AsyncWriteConverse::ask_timeout.

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.