pub struct SendStream { /* private fields */ }Expand description
An outgoing stream, WebTransport-framed when its session is.
finish can leave the
WebTransport header owed, when the connection has no flow-control credit
for it. The FIN then goes out on a later
poll_closed, or on
Drop if credit has returned by then. Dropping immediately after
finishing, with no poll in between, leaves no moment for it to return and
cancels the stream instead, so pair the two when a clean end matters.
Trait Implementations§
Source§impl Debug for SendStream
impl Debug for SendStream
Source§impl Drop for SendStream
impl Drop for SendStream
Source§impl SendStream for SendStream
impl SendStream for SendStream
Source§fn poll_write(
&mut self,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Self::Error>>
fn poll_write( &mut self, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Self::Error>>
Poll to write some of the buffer to the stream, returning how many bytes were
written. See
poll_write_buf for the partial-write
contract, which this shares.Source§fn poll_write_buf<B: Buf>(
&mut self,
cx: &mut Context<'_>,
buf: &mut B,
) -> Poll<Result<usize, Self::Error>>
fn poll_write_buf<B: Buf>( &mut self, cx: &mut Context<'_>, buf: &mut B, ) -> Poll<Result<usize, Self::Error>>
Poll to write some of the given buffer to the stream, advancing it by the
number of bytes written. This may be less than the whole buffer, so callers
loop. Read more
Source§fn set_priority(&mut self, order: u8)
fn set_priority(&mut self, order: u8)
Set the stream’s priority. Read more
Source§fn finish(&mut self) -> Result<(), Self::Error>
fn finish(&mut self) -> Result<(), Self::Error>
Mark the stream as finished, erroring on any future writes. Read more
Auto Trait Implementations§
impl !Freeze for SendStream
impl !RefUnwindSafe for SendStream
impl !Send for SendStream
impl !Sync for SendStream
impl !UnwindSafe for SendStream
impl Unpin for SendStream
impl UnsafeUnpin for SendStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<S> SendStream for Swhere
S: SendStream + 'static,
impl<S> SendStream for Swhere
S: SendStream + 'static,
Source§fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> ⓘ
fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> ⓘ
Write some of the buffer, returning how many bytes were accepted.
Source§fn write_buf<'a, B>(&'a mut self, buf: &'a mut B) -> WriteBuf<'a, Self, B> ⓘwhere
B: Buf,
fn write_buf<'a, B>(&'a mut self, buf: &'a mut B) -> WriteBuf<'a, Self, B> ⓘwhere
B: Buf,
Write some of the buffer, advancing it by the bytes accepted.
Source§fn write_chunk(&mut self, chunk: Bytes) -> WriteChunk<'_, Self> ⓘ
fn write_chunk(&mut self, chunk: Bytes) -> WriteChunk<'_, Self> ⓘ
Write the entire chunk to the stream.
Source§fn closed(&mut self) -> SendClosed<'_, Self> ⓘ
fn closed(&mut self) -> SendClosed<'_, Self> ⓘ
Wait until the stream is closed by either side.