pub trait NodeActor: Send + 'static {
type Error: Debug;
type OutboundData: CancellableContext;
type InboundData: Sized;
type Builder;
// Required methods
fn build(builder: Self::Builder) -> (Self::InboundData, Self);
fn start<'async_trait>(
self,
inbound_context: Self::OutboundData,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
The NodeActor is an actor-like service for the node.
Actors may:
- Handle incoming messages.
- Perform background tasks.
- Emit new events for other actors to process.
Required Associated Types§
Sourcetype OutboundData: CancellableContext
type OutboundData: CancellableContext
The communication context used by the actor. These are the channels that the actor will use to send messages to other actors.
Sourcetype InboundData: Sized
type InboundData: Sized
The inbound communication channels used by the actor. These are the channels that the actor will use to receive messages from other actors.
Required Methods§
Sourcefn build(builder: Self::Builder) -> (Self::InboundData, Self)
fn build(builder: Self::Builder) -> (Self::InboundData, Self)
Builds the actor.
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.