Struct websocket_util::subscribe::Subscription[][src]

pub struct Subscription<S, M, I> where
    M: Message
{ /* fields omitted */ }
Expand description

A subscription associated with a MessageStream that allows for sending and receiving control messages over it.

Notes

  • in order for any send operation to resolve, the associated MessageStream stream needs to be polled; that is necessary because this operation expects a control message response and that control message comes through the regular stream.

Implementations

Send a message over the internal control channel and wait a control message response.

The method returns the following errors:

  • Err(..) when the sink failed to send an item
  • Ok(None) when the message stream got closed
  • Ok(Some(Err(()))) when message classification reported an error; the actual error still manifests through the message stream

Wait for a control message to arrive.

Trait Implementations

Formats the value using the given formatter. 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.

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

Performs the conversion.

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