Skip to main content

Sends

Trait Sends 

Source
pub trait Sends<T: Message> {
    // Required method
    fn send(
        &self,
        msg: T,
    ) -> impl Future<Output = Result<Output<T>, SendError<T>>> + Send + '_;

    // Provided method
    fn send_blocking(&self, msg: T) -> Result<Output<T>, SendError<T>> { ... }
}
Expand description

Implemented for inboxes that can send messages of type T.

Required Methods§

Source

fn send( &self, msg: T, ) -> impl Future<Output = Result<Output<T>, SendError<T>>> + Send + '_

Sends a message of type T to the inbox.

Provided Methods§

Source

fn send_blocking(&self, msg: T) -> Result<Output<T>, SendError<T>>

Same as Sends::send, but blocks the current thread until the message is sent.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T, R> Sends<T> for DynInbox<R>
where T: Message<Kind: MessageSpecifier<T, Output: Send, Payload: Send>>, R: Members + Contains<T>,