RecvStream

Struct RecvStream 

Source
pub struct RecvStream {
    pub transport: Rc<WebTransport>,
    pub stream: WebTransportReceiveStream,
    pub reader: Reader,
    pub unlock_reader_on_drop: bool,
}
Expand description

Recv the data from a WebTransport stream.

Fields§

§transport: Rc<WebTransport>

The WebTransport instance.

§stream: WebTransportReceiveStream

The handle to the stream to read from.

§reader: Reader

A reader to conduct the operation.

§unlock_reader_on_drop: bool

Unlock the reader on drop.

Trait Implementations§

Source§

impl AsyncRead for RecvStream

Source§

fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll<Result<()>>

Attempts to read from the AsyncRead into buf. Read more
Source§

impl Drop for RecvStream

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Finished for RecvStream

Source§

type Error = Error

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

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

Wait for a stream to finish.
Source§

impl Read for RecvStream

Source§

type Error = StreamReadError

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

async fn read(&mut self, buf: &mut [u8]) -> Result<NonZeroUsize, Self::Error>

Read the data from the stream into a given buffer and return the amount of bytes filled in the buffer or None if the stream is closed and does not have any pending unread data. Read more
Source§

impl ReadAbort for RecvStream

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 ReadAborted for RecvStream

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