pub trait IntermediaryEvent<K, M, T>where
    Self: Sized,
    K: Id,
    M: Msg,
    T: EventEntry<K, M>,{
    // Required methods
    fn new(event_id: K, msg: Option<impl Into<M>>, origin: Origin) -> Self;
    fn get_entry(&self) -> &T;
    fn take_entry(&mut self) -> T;

    // Provided methods
    fn get_event_id(&self) -> &K { ... }
    fn finalize(self) -> FinalizedEvent<K> { ... }
    fn into_event_id(self) -> K { ... }
}
Expand description

The IntermediaryEvent trait is used to add information after setting an event, and to be able to automatically capture events once they go out of scope.

Required Methods§

source

fn new(event_id: K, msg: Option<impl Into<M>>, origin: Origin) -> Self

Create a new IntermediaryEvent.

Arguments
  • event_id … The Id of the event
  • msg … An optional Msg set for this event
  • origin … The Origin this event was set
source

fn get_entry(&self) -> &T

Returns the EventEntry that was created by this IntermediaryEvent.

source

fn take_entry(&mut self) -> T

Takes the EventEntry that was created by this IntermediaryEvent.

Provided Methods§

source

fn get_event_id(&self) -> &K

Returns the Id of this event

source

fn finalize(self) -> FinalizedEvent<K>

Finalizing the event sends it to the publisher, and returns the FinalizedEvent. This struct includes the Id used to set the event, and the id of the specific EventEntry associated with this event.

Note: Finalizing prevents any further information to be added to the event.

source

fn into_event_id(self) -> K

Converts this IntermediaryEvent into the related event Id.

Implementors§