Skip to main content

TestCluster

Struct TestCluster 

Source
pub struct TestCluster { /* private fields */ }

Implementations§

Source§

impl TestCluster

Source

pub fn builder() -> TestClusterBuilder

Source

pub async fn ping( &mut self, node_id: &str, echo: &str, ) -> Result<PingResponse, Box<dyn Error>>

Ping a node to verify it’s alive.

Source

pub async fn get_node_info( &mut self, node_id: &str, ) -> Result<NodeInfoResponse, Box<dyn Error>>

Get node info.

Source

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.

Source

pub async fn clear_faults( &mut self, node_id: &str, ) -> Result<(), Box<dyn Error>>

Clear all faults on a node.

Source

pub async fn subscribe_events( &mut self, node_id: &str, event_types: &[&str], ) -> Result<EventStream, Box<dyn Error>>

Subscribe to events from a node.

Source

pub async fn custom( &mut self, node_id: &str, command_type: &str, payload: &[u8], ) -> Result<Vec<u8>, Box<dyn Error>>

Send a custom command.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn stop_actor( &mut self, node_id: &str, actor_name: &str, ) -> Result<StopActorResponse, Box<dyn Error>>

Stop an actor on a node.

Source

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.

Source

pub async fn shutdown_node( &mut self, node_id: &str, ) -> Result<(), Box<dyn Error>>

Graceful shutdown of a specific node.

Source

pub async fn shutdown(&mut self)

Shutdown all nodes.

Trait Implementations§

Source§

impl Drop for TestCluster

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more