overclock::core

Trait Route

Source
pub trait Route<M>:
    Send
    + Sync
    + DynClone {
    // Required methods
    fn try_send_msg<'life0, 'async_trait>(
        &'life0 self,
        message: M,
    ) -> Pin<Box<dyn Future<Output = Result<Option<M>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_msg<'life0, 'async_trait>(
        &'life0 self,
        message: M,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Dynamic route as trait object, should be implemented on the actor’s handle

Required Methods§

Source

fn try_send_msg<'life0, 'async_trait>( &'life0 self, message: M, ) -> Pin<Box<dyn Future<Output = Result<Option<M>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Try to send message to the channel.

Source

fn send_msg<'life0, 'async_trait>( &'life0 self, message: M, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

if the Route is behind lock, drop the lock before invoking this method.

Implementors§

Source§

impl<M: 'static + Send, E> Route<M> for AbortableBoundedHandle<E>
where E: TryFrom<M> + Send, E::Error: Send,

Source§

impl<M: 'static + Send, E> Route<M> for AbortableUnboundedHandle<E>
where E: TryFrom<M> + Send,

Source§

impl<M: 'static + Send, E> Route<M> for BoundedHandle<E>
where E: TryFrom<M> + Send, E::Error: Send,

Source§

impl<M: 'static + Send, E> Route<M> for UnboundedHandle<E>
where E: TryFrom<M> + Send,