Skip to main content

ResetStream

Trait ResetStream 

Source
pub trait ResetStream<E> {
    // Required method
    fn poll_reset(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        code: VarInt,
    ) -> Poll<Result<(), E>>;
}
Expand description

Send-side reset control for a stream.

This operation is stream reset rather than cancellation of a Rust future. The first poll of poll_reset commits the reset code. Once committed, reset may interrupt in-flight send-side work such as data send, flush, or shutdown. Reset does not stop local receive-side byte delivery.

Required Methods§

Source

fn poll_reset( self: Pin<&mut Self>, cx: &mut Context<'_>, code: VarInt, ) -> Poll<Result<(), E>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<P, E> ResetStream<E> for Pin<P>
where P: DerefMut, P::Target: ResetStream<E>,

Source§

fn poll_reset( self: Pin<&mut Self>, cx: &mut Context<'_>, code: VarInt, ) -> Poll<Result<(), E>>

Source§

impl<S, E> ResetStream<E> for &mut S
where S: ResetStream<E> + Unpin + ?Sized,

Source§

fn poll_reset( self: Pin<&mut Self>, cx: &mut Context<'_>, code: VarInt, ) -> Poll<Result<(), E>>

Implementors§

Source§

impl ResetStream<StreamError> for MessageWriter

Source§

impl ResetStream<StreamError> for dyn WriteStream

Source§

impl<StreamState, Send, Flush, Close, Reset, SendFuture, FlushFuture, CloseFuture, ResetFuture, SinkError> ResetStream<StreamError> for Unfold<StreamState, Send, Flush, Close, Reset, SendFuture, FlushFuture, CloseFuture, ResetFuture, SinkError>
where Reset: FnMut(StreamState, VarInt) -> ResetFuture, SendFuture: Future<Output = Either<(StreamState, Result<(), SinkError>), StreamState>>, FlushFuture: Future<Output = Either<(StreamState, Result<(), SinkError>), StreamState>>, CloseFuture: Future<Output = Either<(StreamState, Result<(), SinkError>), StreamState>>, ResetFuture: Future<Output = (StreamState, Result<(), StreamError>)>, SinkError: From<StreamError>,