pub struct TheaterClient { /* private fields */ }Expand description
High-level client for Theater server operations
Implementations§
Source§impl TheaterClient
impl TheaterClient
Sourcepub fn new(address: SocketAddr) -> Self
pub fn new(address: SocketAddr) -> Self
Create a new TheaterClient
Sourcepub async fn address(&self) -> SocketAddr
pub async fn address(&self) -> SocketAddr
Get the server address
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if connected to the server
Sourcepub async fn connect(&self) -> CliResult<()>
pub async fn connect(&self) -> CliResult<()>
Explicitly connect to the server (usually not needed as commands auto-connect)
Sourcepub async fn start_actor(
&self,
manifest_content: String,
initial_state: Option<Vec<u8>>,
parent: bool,
subscribe: bool,
) -> CliResult<()>
pub async fn start_actor( &self, manifest_content: String, initial_state: Option<Vec<u8>>, parent: bool, subscribe: bool, ) -> CliResult<()>
Start an actor from a manifest
Sourcepub async fn stop_actor(&self, actor_id: &str) -> CliResult<()>
pub async fn stop_actor(&self, actor_id: &str) -> CliResult<()>
Stop a running actor
Sourcepub async fn get_actor_state(&self, actor_id: &str) -> CliResult<Value>
pub async fn get_actor_state(&self, actor_id: &str) -> CliResult<Value>
Get actor state
Sourcepub async fn get_actor_events(
&self,
actor_id: &str,
) -> CliResult<Vec<ChainEvent>>
pub async fn get_actor_events( &self, actor_id: &str, ) -> CliResult<Vec<ChainEvent>>
Get actor events
Sourcepub async fn send_message(
&self,
actor_id: &str,
message: Vec<u8>,
) -> CliResult<()>
pub async fn send_message( &self, actor_id: &str, message: Vec<u8>, ) -> CliResult<()>
Send a message to an actor (fire and forget)
Sourcepub async fn request_message(
&self,
actor_id: &str,
message: Vec<u8>,
) -> CliResult<Vec<u8>>
pub async fn request_message( &self, actor_id: &str, message: Vec<u8>, ) -> CliResult<Vec<u8>>
Send a request to an actor and wait for response
Sourcepub async fn subscribe_to_events(
&self,
actor_id: &str,
) -> CliResult<EventStream>
pub async fn subscribe_to_events( &self, actor_id: &str, ) -> CliResult<EventStream>
Subscribe to events from an actor (returns a stream-like interface)
Sourcepub async fn next_response(&self) -> CliResult<ManagementResponse>
pub async fn next_response(&self) -> CliResult<ManagementResponse>
Get the next response from the connection (for streaming operations)
Sourcepub async fn get_actor_status(&self, actor_id: &str) -> CliResult<String>
pub async fn get_actor_status(&self, actor_id: &str) -> CliResult<String>
Get actor status
Sourcepub async fn restart_actor(&self, actor_id: &str) -> CliResult<()>
pub async fn restart_actor(&self, actor_id: &str) -> CliResult<()>
Restart an actor
Sourcepub async fn update_actor_component(
&self,
actor_id: &str,
component: String,
) -> CliResult<()>
pub async fn update_actor_component( &self, actor_id: &str, component: String, ) -> CliResult<()>
Update actor component
Sourcepub async fn unsubscribe_from_actor(
&self,
actor_id: &str,
subscription_id: Uuid,
) -> CliResult<()>
pub async fn unsubscribe_from_actor( &self, actor_id: &str, subscription_id: Uuid, ) -> CliResult<()>
Unsubscribe from actor events
Sourcepub async fn open_channel(
&self,
actor_id: &str,
initial_message: Vec<u8>,
) -> CliResult<String>
pub async fn open_channel( &self, actor_id: &str, initial_message: Vec<u8>, ) -> CliResult<String>
Open a channel with an actor
Sourcepub async fn send_on_channel(
&self,
channel_id: &str,
message: Vec<u8>,
) -> CliResult<()>
pub async fn send_on_channel( &self, channel_id: &str, message: Vec<u8>, ) -> CliResult<()>
Send a message on a channel
Sourcepub async fn close_channel(&self, channel_id: &str) -> CliResult<()>
pub async fn close_channel(&self, channel_id: &str) -> CliResult<()>
Close a channel
Trait Implementations§
Source§impl Clone for TheaterClient
impl Clone for TheaterClient
Source§fn clone(&self) -> TheaterClient
fn clone(&self) -> TheaterClient
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TheaterClient
impl !RefUnwindSafe for TheaterClient
impl Send for TheaterClient
impl Sync for TheaterClient
impl Unpin for TheaterClient
impl !UnwindSafe for TheaterClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more