SendStream

Struct SendStream 

Source
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

Source§

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 more
Source§

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>>

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>>

Like poll_write, except that it writes from a slice of buffers. Read more
Source§

fn is_write_vectored(&self) -> bool

Determines if this writer has an efficient poll_write_vectored implementation. Read more
Source§

impl Drop for SendStream

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Finish for SendStream

Source§

type Error = Error

An error that can occur while finishing the stream.
Source§

async fn finish(self) -> Result<(), Self::Error>

Finish the stream.
Source§

impl Write for SendStream

Source§

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>

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

Source§

type Error = Error

An error that can occur while stopping the stream.
Source§

async fn abort(self, error_code: ErrorCode) -> Result<(), Self::Error>

Abort the stream.
Source§

impl WriteAborted for SendStream

Source§

type Error = Error

An error that can occur while waiting for a stream to be aborted.
Source§

async fn aborted(self) -> Result<ErrorCode, Self::Error>

Wait for a stream’s corresponding read side to abort.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Send for T

Source§

impl<T> Sync for T