Skip to main content

SendsExt

Trait SendsExt 

Source
pub trait SendsExt<T>: Sends<T>
where T: Message,
{ // Provided methods fn request( &self, msg: T, ) -> impl Future<Output = Result<<<<T as Message>::Kind as MessageSpecifier<T>>::Output as MessageReply>::Reply, RequestError<T>>> + Send { ... } fn request_blocking( &self, msg: T, ) -> Result<<<<T as Message>::Kind as MessageSpecifier<T>>::Output as MessageReply>::Reply, RequestError<T>> { ... } }
Expand description

Extension trait for Sends.

Provided Methods§

Source

fn request( &self, msg: T, ) -> impl Future<Output = Result<<<<T as Message>::Kind as MessageSpecifier<T>>::Output as MessageReply>::Reply, RequestError<T>>> + Send

Sends a message of type T to the inbox and waits for a reply, if the message type has a reply type.

This is equivalent to calling Sends::send and then MessageReply::receive.

Source

fn request_blocking( &self, msg: T, ) -> Result<<<<T as Message>::Kind as MessageSpecifier<T>>::Output as MessageReply>::Reply, RequestError<T>>

Same as SendsExt::request, but blocks the current thread until the reply is received.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T, S> SendsExt<T> for S
where T: Message, S: Sends<T>,