pub struct TestCluster { /* private fields */ }Implementations§
Source§impl TestCluster
impl TestCluster
pub fn builder() -> TestClusterBuilder
Sourcepub async fn ping(
&mut self,
node_id: &str,
echo: &str,
) -> Result<PingResponse, Box<dyn Error>>
pub async fn ping( &mut self, node_id: &str, echo: &str, ) -> Result<PingResponse, Box<dyn Error>>
Ping a node to verify it’s alive.
Sourcepub async fn get_node_info(
&mut self,
node_id: &str,
) -> Result<NodeInfoResponse, Box<dyn Error>>
pub async fn get_node_info( &mut self, node_id: &str, ) -> Result<NodeInfoResponse, Box<dyn Error>>
Get node info.
Sourcepub async fn inject_fault(
&mut self,
node_id: &str,
fault_type: &str,
target: &str,
duration_ms: u64,
count: u32,
) -> Result<(), Box<dyn Error>>
pub async fn inject_fault( &mut self, node_id: &str, fault_type: &str, target: &str, duration_ms: u64, count: u32, ) -> Result<(), Box<dyn Error>>
Inject a fault on a node.
Sourcepub async fn clear_faults(
&mut self,
node_id: &str,
) -> Result<(), Box<dyn Error>>
pub async fn clear_faults( &mut self, node_id: &str, ) -> Result<(), Box<dyn Error>>
Clear all faults on a node.
Sourcepub async fn subscribe_events(
&mut self,
node_id: &str,
event_types: &[&str],
) -> Result<EventStream, Box<dyn Error>>
pub async fn subscribe_events( &mut self, node_id: &str, event_types: &[&str], ) -> Result<EventStream, Box<dyn Error>>
Subscribe to events from a node.
Sourcepub async fn custom(
&mut self,
node_id: &str,
command_type: &str,
payload: &[u8],
) -> Result<Vec<u8>, Box<dyn Error>>
pub async fn custom( &mut self, node_id: &str, command_type: &str, payload: &[u8], ) -> Result<Vec<u8>, Box<dyn Error>>
Send a custom command.
Sourcepub async fn spawn_actor(
&mut self,
node_id: &str,
actor_type: &str,
actor_name: &str,
args: &[u8],
) -> Result<SpawnActorResponse, Box<dyn Error>>
pub async fn spawn_actor( &mut self, node_id: &str, actor_type: &str, actor_name: &str, args: &[u8], ) -> Result<SpawnActorResponse, Box<dyn Error>>
Spawn an actor on a node.
Sourcepub async fn tell_actor(
&mut self,
node_id: &str,
actor_name: &str,
message_type: &str,
payload: &[u8],
) -> Result<TellActorResponse, Box<dyn Error>>
pub async fn tell_actor( &mut self, node_id: &str, actor_name: &str, message_type: &str, payload: &[u8], ) -> Result<TellActorResponse, Box<dyn Error>>
Send a fire-and-forget message to an actor on a node.
Sourcepub async fn ask_actor(
&mut self,
node_id: &str,
actor_name: &str,
message_type: &str,
payload: &[u8],
) -> Result<AskActorResponse, Box<dyn Error>>
pub async fn ask_actor( &mut self, node_id: &str, actor_name: &str, message_type: &str, payload: &[u8], ) -> Result<AskActorResponse, Box<dyn Error>>
Send a request-reply message to an actor on a node.
Sourcepub async fn ask_actor_with_timeout(
&mut self,
node_id: &str,
actor_name: &str,
message_type: &str,
payload: &[u8],
timeout_ms: u64,
) -> Result<AskActorResponse, Box<dyn Error>>
pub async fn ask_actor_with_timeout( &mut self, node_id: &str, actor_name: &str, message_type: &str, payload: &[u8], timeout_ms: u64, ) -> Result<AskActorResponse, Box<dyn Error>>
Send a request-reply message to an actor on a node with a timeout.
If timeout_ms > 0, the ask is cancelled after that many milliseconds.
Sourcepub async fn stop_actor(
&mut self,
node_id: &str,
actor_name: &str,
) -> Result<StopActorResponse, Box<dyn Error>>
pub async fn stop_actor( &mut self, node_id: &str, actor_name: &str, ) -> Result<StopActorResponse, Box<dyn Error>>
Stop an actor on a node.
Sourcepub async fn watch_actor(
&mut self,
node_id: &str,
watcher_name: &str,
target_name: &str,
) -> Result<WatchActorResponse, Box<dyn Error>>
pub async fn watch_actor( &mut self, node_id: &str, watcher_name: &str, target_name: &str, ) -> Result<WatchActorResponse, Box<dyn Error>>
Register a watch: when target_name stops, watcher_name is notified.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestCluster
impl !RefUnwindSafe for TestCluster
impl Send for TestCluster
impl Sync for TestCluster
impl Unpin for TestCluster
impl UnsafeUnpin for TestCluster
impl !UnwindSafe for TestCluster
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request