pub struct TestNode { /* private fields */ }Implementations§
Source§impl TestNode
impl TestNode
pub fn new(config: TestNodeConfig) -> Self
Sourcepub fn with_handler(
config: TestNodeConfig,
handler: Arc<dyn CommandHandler>,
) -> Self
pub fn with_handler( config: TestNodeConfig, handler: Arc<dyn CommandHandler>, ) -> Self
Create a TestNode with a command handler for actor management.
pub async fn run(self) -> Result<(), Box<dyn Error>>
pub fn emit_event(&self, event_type: &str, detail: &str)
Trait Implementations§
Source§impl TestNodeService for TestNode
impl TestNodeService for TestNode
Source§type SubscribeEventsStream = Pin<Box<dyn Stream<Item = Result<NodeEvent, Status>> + Send>>
type SubscribeEventsStream = Pin<Box<dyn Stream<Item = Result<NodeEvent, Status>> + Send>>
Server streaming response type for the SubscribeEvents method.
Source§fn ping<'life0, 'async_trait>(
&'life0 self,
request: Request<PingRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<PingResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ping<'life0, 'async_trait>(
&'life0 self,
request: Request<PingRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<PingResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ping — verify the node is alive and the control channel works
Source§fn get_node_info<'life0, 'async_trait>(
&'life0 self,
_request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<NodeInfoResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_node_info<'life0, 'async_trait>(
&'life0 self,
_request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<NodeInfoResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Node info
Source§fn shutdown<'life0, 'async_trait>(
&'life0 self,
request: Request<ShutdownRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
request: Request<ShutdownRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Shutdown
Source§fn inject_fault<'life0, 'async_trait>(
&'life0 self,
request: Request<FaultRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn inject_fault<'life0, 'async_trait>(
&'life0 self,
request: Request<FaultRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fault injection
fn clear_faults<'life0, 'async_trait>(
&'life0 self,
_request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn subscribe_events<'life0, 'async_trait>(
&'life0 self,
request: Request<EventFilter>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribeEventsStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_events<'life0, 'async_trait>(
&'life0 self,
request: Request<EventFilter>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribeEventsStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Event subscription (server-streaming)
Source§fn custom_command<'life0, 'async_trait>(
&'life0 self,
request: Request<CustomRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CustomResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn custom_command<'life0, 'async_trait>(
&'life0 self,
request: Request<CustomRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CustomResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Custom application commands
Source§fn spawn_actor<'life0, 'async_trait>(
&'life0 self,
request: Request<SpawnActorRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SpawnActorResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn_actor<'life0, 'async_trait>(
&'life0 self,
request: Request<SpawnActorRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SpawnActorResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Actor management
fn tell_actor<'life0, 'async_trait>(
&'life0 self,
request: Request<TellActorRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<TellActorResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ask_actor<'life0, 'async_trait>(
&'life0 self,
request: Request<AskActorRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<AskActorResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop_actor<'life0, 'async_trait>(
&'life0 self,
request: Request<StopActorRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StopActorResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn watch_actor<'life0, 'async_trait>(
&'life0 self,
request: Request<WatchActorRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<WatchActorResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn watch_actor<'life0, 'async_trait>(
&'life0 self,
request: Request<WatchActorRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<WatchActorResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Watch another actor — receive event when target stops
Auto Trait Implementations§
impl Freeze for TestNode
impl !RefUnwindSafe for TestNode
impl Send for TestNode
impl Sync for TestNode
impl Unpin for TestNode
impl UnsafeUnpin for TestNode
impl !UnwindSafe for TestNode
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