pub struct NewEvent<AggregateType, AggregateId, EventType> {
pub aggregate_type: AggregateType,
pub aggregate_id: AggregateId,
pub sequence: i64,
pub event_type: EventType,
pub payload: Value,
}Expand description
Named fields required to create a new domain event.
The string fields accept either borrowed values such as "Product" or
owned String values. Event::new converts them into owned strings.
Fields§
§aggregate_type: AggregateTypeAggregate type (for example, "Product").
aggregate_id: AggregateIdAggregate instance identifier.
sequence: i64Next sequence number in this aggregate’s event stream.
event_type: EventTypeEvent type in past-tense PascalCase (for example, "ProductCreated").
payload: ValueEvent-specific data.
Trait Implementations§
Auto Trait Implementations§
impl<AggregateType, AggregateId, EventType> Freeze for NewEvent<AggregateType, AggregateId, EventType>
impl<AggregateType, AggregateId, EventType> RefUnwindSafe for NewEvent<AggregateType, AggregateId, EventType>
impl<AggregateType, AggregateId, EventType> Send for NewEvent<AggregateType, AggregateId, EventType>
impl<AggregateType, AggregateId, EventType> Sync for NewEvent<AggregateType, AggregateId, EventType>
impl<AggregateType, AggregateId, EventType> Unpin for NewEvent<AggregateType, AggregateId, EventType>
impl<AggregateType, AggregateId, EventType> UnsafeUnpin for NewEvent<AggregateType, AggregateId, EventType>
impl<AggregateType, AggregateId, EventType> UnwindSafe for NewEvent<AggregateType, AggregateId, EventType>
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