pub struct SendStream {
pub transport: Rc<WebTransport>,
pub stream: WebTransportSendStream,
pub writer: Writer,
pub unlock_writer_on_drop: bool,
}
Expand description
Send the data into a WebTransport stream.
Fields§
§transport: Rc<WebTransport>
The WebTransport instance.
stream: WebTransportSendStream
The handle to the stream to write to.
writer: Writer
A writer to conduct the operation.
unlock_writer_on_drop: bool
Unlock the writer on drop.
Trait Implementations§
Source§impl AsyncWrite for SendStream
impl AsyncWrite for SendStream
Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf
into the object. Read moreSource§fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempts to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§fn poll_shutdown(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_shutdown( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Initiates or attempts to shut down this writer, returning success when
the I/O connection has completely shut down. Read more
Source§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize, Error>>
fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize, Error>>
Like
poll_write
, except that it writes from a slice of buffers. Read moreSource§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Determines if this writer has an efficient
poll_write_vectored
implementation. Read moreSource§impl Drop for SendStream
impl Drop for SendStream
Source§impl Finish for SendStream
impl Finish for SendStream
Source§impl Write for SendStream
impl Write for SendStream
Source§type Error = StreamWriteError
type Error = StreamWriteError
An error that can occur while writing to the stream.
Source§async fn write(&mut self, buf: &[u8]) -> Result<NonZeroUsize, Self::Error>
async fn write(&mut self, buf: &[u8]) -> Result<NonZeroUsize, Self::Error>
Write the data from the given buffer into the stream, returning
the amount of of bytes that were successfully written into the stream.
If the returned amount is smaller than the size of the data that was
being written, the user should try writing the remaining data again.
Source§impl WriteAbort for SendStream
impl WriteAbort for SendStream
Auto Trait Implementations§
impl Freeze for SendStream
impl !RefUnwindSafe for SendStream
impl !Send for SendStream
impl !Sync for SendStream
impl Unpin for SendStream
impl !UnwindSafe 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