pub trait ActorRef<MsgT>:
DynClone
+ Send
+ Debugwhere
MsgT: ActorMsg + 'static,{
// Required methods
fn send(&mut self, message: MsgT, delay: Option<Duration>);
fn set_handler(&mut self, handler: DynMsgHandler<MsgT>);
fn spawn_async_send(
&mut self,
f: impl Future<Output = MsgT> + Send + 'static,
delay: Option<Duration>,
);
fn spawn_thread_blocking_send(
&mut self,
f: impl FnOnce() -> MsgT + Send + 'static,
delay: Option<Duration>,
);
}Expand description
Required Methods§
fn send(&mut self, message: MsgT, delay: Option<Duration>)
fn set_handler(&mut self, handler: DynMsgHandler<MsgT>)
fn spawn_async_send( &mut self, f: impl Future<Output = MsgT> + Send + 'static, delay: Option<Duration>, )
fn spawn_thread_blocking_send( &mut self, f: impl FnOnce() -> MsgT + Send + 'static, delay: Option<Duration>, )
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.