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§
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>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".