pub trait Responder {
// Required method
fn respond<C>(
self,
) -> impl Future<Output = Result<impl Stream<Item = Result<impl ReceivedCommand<C> + Send + Sync + 'static, Error>> + Send + 'static, Error>> + Send + 'static
where C: Command + 'static;
}Expand description
Re-exported so services only need to depend on arminius-lib-nats.
The message-bus Subscriber trait
is intentionally not re-exported here to avoid clashing with the
async_nats::Subscriber re-export above; reach it via
arminius_lib_message_bus::Subscriber.
Subscribes to incoming commands. Mirrors Subscriber.
respond takes self by value so the returned future is 'static with no
borrow of the implementor. Callers that need to keep a handle should clone
before calling (e.g. conn.clone().respond::<C>()).
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".