Skip to main content

NativeStreamSession

Trait NativeStreamSession 

Source
pub trait NativeStreamSession: Debug {
    // Required methods
    fn send(
        &self,
        message: Box<dyn Any>,
    ) -> LocalBoxFuture<'static, Result<(), RuntimeFailure>>;
    fn receive(
        &self,
    ) -> LocalBoxFuture<'static, Result<NativeStreamItem, RuntimeFailure>>;
    fn close_send(&self) -> LocalBoxFuture<'static, Result<(), RuntimeFailure>>;
    fn cancel(&self);
}
Expand description

Adapter-owned bidirectional stream session.

Required Methods§

Source

fn send( &self, message: Box<dyn Any>, ) -> LocalBoxFuture<'static, Result<(), RuntimeFailure>>

Sends one message, applying the Adapter’s bounded admission policy.

Source

fn receive( &self, ) -> LocalBoxFuture<'static, Result<NativeStreamItem, RuntimeFailure>>

Receives one message, half-close marker, or terminal outcome.

Source

fn close_send(&self) -> LocalBoxFuture<'static, Result<(), RuntimeFailure>>

Closes this side’s sending direction without terminating the peer receive direction.

Source

fn cancel(&self)

Cancels the session idempotently and prevents later delivery to application code.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§