pub(crate) trait Actor:
Any
+ ActorAsAny
+ Send
+ Sync
+ MallocSizeOf {
// Required method
fn name(&self) -> &str;
// Provided methods
fn handle_message(
&self,
request: ClientRequest<'_, '_>,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream_id: StreamId,
) -> Result<(), ActorError> { ... }
fn cleanup(&self, _id: StreamId) { ... }
}Expand description
A common trait for all devtools actors that encompasses an immutable name and the ability to process messages that are directed to particular actors.
Required Methods§
Provided Methods§
fn handle_message( &self, request: ClientRequest<'_, '_>, registry: &ActorRegistry, msg_type: &str, msg: &Map<String, Value>, stream_id: StreamId, ) -> Result<(), ActorError>
fn cleanup(&self, _id: StreamId)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".