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§
Sourcefn send(
&self,
message: Box<dyn Any>,
) -> LocalBoxFuture<'static, Result<(), RuntimeFailure>>
fn send( &self, message: Box<dyn Any>, ) -> LocalBoxFuture<'static, Result<(), RuntimeFailure>>
Sends one message, applying the Adapter’s bounded admission policy.
Sourcefn receive(
&self,
) -> LocalBoxFuture<'static, Result<NativeStreamItem, RuntimeFailure>>
fn receive( &self, ) -> LocalBoxFuture<'static, Result<NativeStreamItem, RuntimeFailure>>
Receives one message, half-close marker, or terminal outcome.
Sourcefn close_send(&self) -> LocalBoxFuture<'static, Result<(), RuntimeFailure>>
fn close_send(&self) -> LocalBoxFuture<'static, Result<(), RuntimeFailure>>
Closes this side’s sending direction without terminating the peer receive direction.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".