pub struct SendStream(_);
Expand description

A writeable QUIC stream

Implementations

Enqueues a chunk of data for sending it towards the peer.

The method will return:

  • Poll::Ready(Ok(())) if the data was enqueued for sending. The provided Bytes will be replaced with an empty Bytes, in order to reduce needless ref count increases.
  • Poll::Ready(Err(stream_error)) if the data could not be sent, because the stream had previously entered an error state.
  • Poll::Pending if the send buffer capacity is currently exhausted. In this case, the caller should retry sending after the Waker on the provided Context is notified.

Enqueues a slice of chunks of data for sending it towards the peer.

The method will return:

  • Poll::Ready(Ok(count)) if part of the slice was enqueued for sending. Any of the consumed Bytes will be replaced with an empty Bytes, in order to reduce needless ref count increases. If count does not equal the total number of chunks, the stream will store the waker and wake the task once more capacity is available.
  • Poll::Ready(Err(stream_error)) if the data could not be sent, because the stream had previously entered an error state.
  • Poll::Pending if the send buffer capacity is currently exhausted. In this case, the caller should retry sending after the Waker on the provided Context is notified.

Polls send readiness for the given stream.

The method will return:

  • Poll::Ready(Ok(available_bytes)) if the stream is ready to send data, where available_bytes is how many bytes the stream can currently accept.
  • Poll::Ready(Err(stream_error)) if the data could not be sent, because the stream had previously entered an error state.
  • Poll::Pending if the send buffer capacity is currently exhausted. In this case, the caller should retry sending after the Waker on the provided Context is notified.

Enqueues a chunk of data for sending it towards the peer.

This method should only be called after calling poll_send_ready first, as the stream may not have available send buffer capacity.

The method will return:

  • Ok(()) if the data was enqueued for sending.
  • Err(stream_error) if the data could not be sent, because the stream had previously entered an error state, or the stream was not ready to send data.

Flushes the send buffer and waits for acknowledgement from the peer.

The method will return:

  • Poll::Ready(Ok(())) if the send buffer was completely flushed and acknowledged.
  • Poll::Ready(Err(stream_error)) if the stream could not be flushed, because the stream had previously entered an error state.
  • Poll::Pending if the send buffer is still being flushed. In this case, the caller should retry sending after the Waker on the provided Context is notified.

Marks the stream as finished.

The method will return:

  • Ok(()) if the stream was finished successfully
  • Err(stream_error) if the stream could not be finished, because the stream had previously entered an error state.

Marks the stream as finished and waits for all outstanding data to be acknowledged

The method will return:

  • Poll::Ready(Ok(())) if the stream was completely flushed and acknowledged.
  • Poll::Ready(Err(stream_error)) if the stream could not be flushed, because the stream had previously entered an error state.
  • Poll::Pending if the stream is still being flushed. In this case, the caller should retry sending after the Waker on the provided Context is notified.

Initiates a RESET on the stream.

This will close the stream and notify the peer of the provided error_code.

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

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.