Struct quinn::generic::SendStream [−][src]
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]
S: Session,
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]
&'a mut self,
bufs: &'a mut [Bytes]
) -> WriteChunks<'a, S>
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]
&'a mut self,
bufs: &'a mut [Bytes]
) -> WriteAllChunks<'a, S>
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]
S: Session,
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
[src]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
[src]
pub fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
impl<S> AsyncWrite for SendStream<S> where
S: Session,
[src]
S: Session,
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
[src]
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
[src]
pub fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
pub fn is_write_vectored(&self) -> bool
[src]
impl<S: Debug> Debug for SendStream<S> where
S: Session,
[src]
S: Session,
impl<S> Drop for SendStream<S> where
S: Session,
[src]
S: Session,
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]
T: 'static + ?Sized,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
W: AsyncWrite + ?Sized,
pub fn flush(&mut self) -> Flush<'_, Self> where
Self: Unpin,
Self: Unpin,
pub fn close(&mut self) -> Close<'_, Self> where
Self: Unpin,
Self: Unpin,
pub fn write(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> where
Self: Unpin,
Self: Unpin,
pub fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self> where
Self: Unpin,
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self> where
Self: Unpin,
pub fn write_all(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, Self> where
Self: Unpin,
Self: Unpin,
pub fn into_sink<Item>(self) -> IntoSink<Self, Item> where
Item: AsRef<[u8]>,
Item: AsRef<[u8]>,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,