Skip to main content

ByteStreamStateInterface

Trait ByteStreamStateInterface 

Source
pub trait ByteStreamStateInterface: MaybeSend + MaybeSync {
Show 15 methods // Required methods fn desired_size(&self) -> Option<isize>; fn close(&self); fn enqueue_bytes(&self, chunk: Bytes); fn error(&self, error: StreamError); fn is_buffer_empty(&self) -> bool; fn buffer_size(&self) -> usize; fn is_closed(&self) -> bool; fn is_errored(&self) -> bool; fn closed( &self, ) -> Pin<Box<dyn Future<Output = Result<(), StreamError>> + Send + '_>>; fn poll_read_into( &self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize, StreamError>>; fn poll_read_chunk( &self, cx: &mut Context<'_>, ) -> Poll<Result<Option<Bytes>, StreamError>>; fn begin_pull_into(&self, buf: BytesMut) -> PullIntoOutcome; fn take_pull_into(&self) -> Option<PendingPullInto>; fn return_pull_into(&self, pending: PendingPullInto); fn cancel_source<'a>( &'a self, reason: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(), StreamError>> + Send + 'a>>;
}

Required Methods§

Source

fn desired_size(&self) -> Option<isize>

Source

fn close(&self)

Source

fn enqueue_bytes(&self, chunk: Bytes)

Source

fn error(&self, error: StreamError)

Source

fn is_buffer_empty(&self) -> bool

Source

fn buffer_size(&self) -> usize

Source

fn is_closed(&self) -> bool

Source

fn is_errored(&self) -> bool

Source

fn closed( &self, ) -> Pin<Box<dyn Future<Output = Result<(), StreamError>> + Send + '_>>

Source

fn poll_read_into( &self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize, StreamError>>

Source

fn poll_read_chunk( &self, cx: &mut Context<'_>, ) -> Poll<Result<Option<Bytes>, StreamError>>

Source

fn begin_pull_into(&self, buf: BytesMut) -> PullIntoOutcome

Source

fn take_pull_into(&self) -> Option<PendingPullInto>

Source

fn return_pull_into(&self, pending: PendingPullInto)

Source

fn cancel_source<'a>( &'a self, reason: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(), StreamError>> + Send + 'a>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Source> ByteStreamStateInterface for ByteStreamState<Source>
where Source: ReadableByteSource + 'static,