Struct quinn::generic::SendStream[][src]

pub struct SendStream<S> where
    S: Session
{ /* fields omitted */ }

A stream that can only be used to send data

If dropped, streams that haven’t been explicitly reset() will continue to (re)transmit previously written data until it has been fully acknowledged or the connection is closed.

Implementations

impl<S> SendStream<S> where
    S: Session
[src]

pub fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, S>[src]

Write bytes to the stream

Yields the number of bytes written on success. Congestion and flow control may cause this to be shorter than buf.len(), indicating that only a prefix of buf was written.

pub fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, S>[src]

Convenience method to write an entire buffer to the stream

pub fn write_chunks<'a>(
    &'a mut self,
    bufs: &'a mut [Bytes]
) -> WriteChunks<'a, S>
[src]

Write chunks to the stream

Yields the number of bytes and chunks written on success. Congestion and flow control may cause this to be shorter than buf.len(), indicating that only a prefix of bufs was written

pub fn write_chunk(&mut self, buf: Bytes) -> WriteChunk<'_, S>[src]

Convenience method to write a single chunk in its entirety to the stream

pub fn write_all_chunks<'a>(
    &'a mut self,
    bufs: &'a mut [Bytes]
) -> WriteAllChunks<'a, S>
[src]

Convenience method to write an entire list of chunks to the stream

pub fn finish(&mut self) -> Finish<'_, S>[src]

Shut down the send stream gracefully.

No new data may be written after calling this method. Completes when the peer has acknowledged all sent data, retransmitting data as needed.

pub fn reset(&mut self, error_code: VarInt) -> Result<(), UnknownStream>[src]

Close the send stream immediately.

No new data can be written after calling this method. Locally buffered data is dropped, and previously transmitted data will no longer be retransmitted if lost. If an attempt has already been made to finish the stream, the peer may still receive all written data.

pub fn set_priority(&self, priority: i32) -> Result<(), UnknownStream>[src]

Set the priority of the send stream

Every send stream has an initial priority of 0. Locally buffered data from streams with higher priority will be transmitted before data from streams with lower priority. Changing the priority of a stream with pending data may only take effect after that data has been transmitted. Using many different priority levels per connection may have a negative impact on performance.

pub fn priority(&self) -> Result<i32, UnknownStream>[src]

Get the priority of the send stream

pub fn stopped(&mut self) -> Stopped<'_, S>[src]

Completes if/when the peer stops the stream, yielding the error code

pub fn id(&self) -> StreamId[src]

Get the identity of this stream

Trait Implementations

impl<S> AsyncWrite for SendStream<S> where
    S: Session
[src]

impl<S> AsyncWrite for SendStream<S> where
    S: Session
[src]

impl<S: Debug> Debug for SendStream<S> where
    S: Session
[src]

impl<S> Drop for SendStream<S> where
    S: Session
[src]

Auto Trait Implementations

impl<S> !RefUnwindSafe for SendStream<S>

impl<S> Send for SendStream<S>

impl<S> Sync for SendStream<S>

impl<S> Unpin for SendStream<S>

impl<S> !UnwindSafe for SendStream<S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,