pub trait Actor: Any {
// Required methods
fn id(&self) -> Ustr;
fn handle(&mut self, msg: &dyn Any);
fn as_any(&self) -> &dyn Any;
// Provided method
fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized { ... }
}
Required Methods§
Provided Methods§
Sourcefn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Returns a mutable reference to self
as Any
, for downcasting support.
Default implementation simply coerces &mut Self
to &mut dyn Any
.
§Note
This method is not object-safe and thus only available on sized Self
.