pub trait ReceivedEvent<E: Event>: Deref<Target = E> {
// Required methods
fn ack(&self) -> impl Future<Output = Result<(), Error>> + Send;
fn context(&self) -> &Context;
// Provided method
fn event(&self) -> &E { ... }
}Expand description
An event received from the message bus that can be acknowledged.
Implements Deref to give direct access to the inner event data.
Required Methods§
Sourcefn ack(&self) -> impl Future<Output = Result<(), Error>> + Send
fn ack(&self) -> impl Future<Output = Result<(), Error>> + Send
Acknowledge processing of this event.
Tells the message broker that the event was processed successfully and should not be redelivered. If acknowledgment fails, the event may be reprocessed by this or another service instance.
§Errors
Returns Error::AckFailed if the acknowledgment could not be sent.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".