pub struct CqrsOptions<TCommand, TEvent> {
pub name: String,
pub handlers: Vec<CqrsCommandHandlerDefinition<TCommand, TEvent>>,
pub events: Option<Vec<String>>,
pub now: Rc<dyn Fn() -> u64>,
pub dedupe: CqrsDedupePolicy,
}Expand description
CqrsOptions data container.
Fields§
§name: Stringname field for name.
handlers: Vec<CqrsCommandHandlerDefinition<TCommand, TEvent>>handlers field for handlers.
events: Option<Vec<String>>events field for events.
now: Rc<dyn Fn() -> u64>now field for now.
dedupe: CqrsDedupePolicydedupe field for dedupe.
Implementations§
Source§impl<TCommand, TEvent> CqrsOptions<TCommand, TEvent>
impl<TCommand, TEvent> CqrsOptions<TCommand, TEvent>
Sourcepub fn with_handlers(
self,
handlers: Vec<CqrsCommandHandlerDefinition<TCommand, TEvent>>,
) -> Self
pub fn with_handlers( self, handlers: Vec<CqrsCommandHandlerDefinition<TCommand, TEvent>>, ) -> Self
Updates or reads with_handlers.
Sourcepub fn with_events(
self,
events: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_events( self, events: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Updates or reads with_events.
Sourcepub fn with_dedupe(self, dedupe: CqrsDedupePolicy) -> Self
pub fn with_dedupe(self, dedupe: CqrsDedupePolicy) -> Self
Updates or reads with_dedupe.
Trait Implementations§
Source§impl<TCommand: Clone, TEvent: Clone> Clone for CqrsOptions<TCommand, TEvent>
impl<TCommand: Clone, TEvent: Clone> Clone for CqrsOptions<TCommand, TEvent>
Source§fn clone(&self) -> CqrsOptions<TCommand, TEvent>
fn clone(&self) -> CqrsOptions<TCommand, TEvent>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<TCommand, TEvent> Freeze for CqrsOptions<TCommand, TEvent>
impl<TCommand, TEvent> !RefUnwindSafe for CqrsOptions<TCommand, TEvent>
impl<TCommand, TEvent> !Send for CqrsOptions<TCommand, TEvent>
impl<TCommand, TEvent> !Sync for CqrsOptions<TCommand, TEvent>
impl<TCommand, TEvent> Unpin for CqrsOptions<TCommand, TEvent>
impl<TCommand, TEvent> UnsafeUnpin for CqrsOptions<TCommand, TEvent>
impl<TCommand, TEvent> !UnwindSafe for CqrsOptions<TCommand, TEvent>
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