pub trait Actor:
Send
+ Sync
+ Any {
// Required methods
fn label(&self) -> &str;
fn as_any(&self) -> &(dyn Any + 'static);
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static);
fn into_any(self: Box<Self>) -> Box<dyn Any>;
}Expand description
Re-export identity port traits and JSON stubs from photon_core.
Opaque actor handle for handler execution.
Bound as Send + Sync so handlers may take Arc<dyn Actor> across await
points in the subscribe invoker future.
Implementors must provide the Any downcast helpers (standard bodies):
ⓘ
fn as_any(&self) -> &dyn Any { self }
fn as_any_mut(&mut self) -> &mut dyn Any { self }
fn into_any(self: Box<Self>) -> Box<dyn Any> { self }Or expand actor_downcast_methods! inside the impl Actor block.
Required Methods§
Sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Downcast to Any (mutable).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".