pub trait SendsExt<T: Message>: Sends<T> {
// Provided methods
fn request(
&self,
msg: T,
) -> impl Future<Output = Result<Reply<T>, RequestError<T>>> + Send + '_ { ... }
fn request_blocking(&self, msg: T) -> Result<Reply<T>, RequestError<T>> { ... }
}Expand description
Extension trait for Sends.
Provided Methods§
Sourcefn request(
&self,
msg: T,
) -> impl Future<Output = Result<Reply<T>, RequestError<T>>> + Send + '_
fn request( &self, msg: T, ) -> impl Future<Output = Result<Reply<T>, 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.
Sourcefn request_blocking(&self, msg: T) -> Result<Reply<T>, RequestError<T>>
fn request_blocking(&self, msg: T) -> Result<Reply<T>, 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".