Skip to main content

RecipientExt

Trait RecipientExt 

Source
pub trait RecipientExt<M> {
    // Required methods
    fn send_now(&self, message: M) -> Result<(), SendError>;
    fn send_timed(&self, message: M, fire_at: Instant) -> Result<(), SendError>;
    fn send_recurring(
        &self,
        factory: impl FnMut() -> M + Send + 'static,
        fire_at: Instant,
        interval: Duration,
    ) -> Result<(), SendError>;

    // Provided method
    fn send_delayed(&self, message: M, delay: Duration) -> Result<(), SendError> { ... }
}
Expand description

Convenience methods for Recipients that accept TimedMessages.

Required Methods§

Source

fn send_now(&self, message: M) -> Result<(), SendError>

Send a message now. Convenience to wrap message in TimedMessage::Instant.

Source

fn send_timed(&self, message: M, fire_at: Instant) -> Result<(), SendError>

Send a message to be delivered later at a certain instant.

Source

fn send_recurring( &self, factory: impl FnMut() -> M + Send + 'static, fire_at: Instant, interval: Duration, ) -> Result<(), SendError>

Schedule sending of message at fire_at plus at regular intervals from that point on.

Provided Methods§

Source

fn send_delayed(&self, message: M, delay: Duration) -> Result<(), SendError>

Send a message to be delivered later after some time from now.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§