pub struct Node { /* private fields */ }Expand description
An actor which helps to manage the IPC connections.
The node can hold multiple IpcListeners to accept incoming IPC connections on several
endpoints in parallel. Outbound connections are initiated by sending a
Connect<C> command.
Implementations§
Source§impl Node
impl Node
Sourcepub fn with_listener<L>(self, listener: L) -> Selfwhere
L: IpcListener,
pub fn with_listener<L>(self, listener: L) -> Selfwhere
L: IpcListener,
Adds an IPC listener to the node.
If the node already has a listener listening on the same endpoint, the new listener will
replace the existing one, since the node is not started yet when this method is available.
Note this is not the same as the AddListener command, which will
not replace the existing listener.
Sourcepub fn with_actor<A, S>(self, label: S, actor: Address<A>) -> Self
pub fn with_actor<A, S>(self, label: S, actor: Address<A>) -> Self
Adds an remote addressable actor to the node.
It also registers a label for the actor so that remote actors can look it up by a more user-friendly name.
Duplicate actors and labels are silently skipped.
Sourcepub fn with_factory<A>(self) -> Selfwhere
A: Actor + RemoteSpawnable,
pub fn with_factory<A>(self) -> Selfwhere
A: Actor + RemoteSpawnable,
Adds an remote spawnable actor factory to the node.
Remote nodes can create instances of this actor type by sending a CreateActor node
command.
Trait Implementations§
Source§impl Actor for Node
impl Actor for Node
Source§fn stopping(
&mut self,
ctx: &mut Self::Context,
) -> impl Future<Output = Result<Stopping, Self::Error>> + Send
fn stopping( &mut self, ctx: &mut Self::Context, ) -> impl Future<Output = Result<Stopping, Self::Error>> + Send
Source§impl<L> Handler<AddListener<L>> for Nodewhere
L: IpcListener,
impl<L> Handler<AddListener<L>> for Nodewhere
L: IpcListener,
Source§impl<A> Handler<RemoteCreateActor<A>> for Nodewhere
A: Actor + RemoteSpawnable,
impl<A> Handler<RemoteCreateActor<A>> for Nodewhere
A: Actor + RemoteSpawnable,
Source§type Result = FutureMessageResult<RemoteCreateActor<A>>
type Result = FutureMessageResult<RemoteCreateActor<A>>
MessageResponse.Source§impl<A> Handler<RemoteGetActor<A>> for Nodewhere
A: Actor + RemoteAddressable,
impl<A> Handler<RemoteGetActor<A>> for Nodewhere
A: Actor + RemoteAddressable,
Source§type Result = FutureMessageResult<RemoteGetActor<A>>
type Result = FutureMessageResult<RemoteGetActor<A>>
MessageResponse.