Skip to main content

TestNode

Struct TestNode 

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

Implementations§

Source§

impl TestNode

Source

pub fn new(config: TestNodeConfig) -> Self

Source

pub fn with_handler( config: TestNodeConfig, handler: Arc<dyn CommandHandler>, ) -> Self

Create a TestNode with a command handler for actor management.

Source

pub async fn run(self) -> Result<(), Box<dyn Error>>

Source

pub fn emit_event(&self, event_type: &str, detail: &str)

Trait Implementations§

Source§

impl TestNodeService for TestNode

Source§

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,

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,

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,

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,

Fault injection
Source§

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,

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,

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,

Actor management
Source§

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,

Source§

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,

Source§

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,

Watch another actor — receive event when target stops

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