Skip to main content

acktor_ipc/session/
command.rs

1//! Commands which can be used to interact with a session.
2//!
3
4use acktor::Message;
5
6use crate::actor_handle::ActorHandle;
7use crate::errors::SessionError;
8use crate::remote_address::RemoteAddress;
9
10type Result<T> = std::result::Result<T, SessionError>;
11
12/// A command which is used to create an actor in a remote node.
13///
14/// The remote node needs to know how to create the actor with the given type and config. If
15/// the operation is successful, the provided `label` will be used as the actor label of the
16/// new actor created in the remote node.
17#[derive(Debug, Message)]
18#[result_type(Result<RemoteAddress>)]
19pub struct CreateRemoteActor {
20    pub label: String,
21    pub r#type: String,
22    pub config: String,
23}
24
25/// A command which is used to get the address of an actor in a remote node.
26#[derive(Debug, Message)]
27#[result_type(Result<RemoteAddress>)]
28pub struct GetRemoteActor {
29    pub actor: ActorHandle,
30}