pub struct StockOnHand { /* private fields */ }Expand description
Units received and units issued, as two sums.
stock-on-hand: it converges because addition does not care about order,
and the declaration below is what makes that a checked property rather than
luck (SY-20). The sums saturate, and saturating addition of unsigned values
is still commutative and associative, so even an overflow cannot make the
answer depend on arrival.
Trait Implementations§
impl ConvergentProjection for StockOnHand
Source§impl Debug for StockOnHand
impl Debug for StockOnHand
Source§impl Projection for StockOnHand
impl Projection for StockOnHand
Source§type Store = MemoryProjectionStore
type Store = MemoryProjectionStore
The store this read model and its checkpoint live in.
Source§type Error = MemoryProjectionStoreError
type Error = MemoryProjectionStoreError
The projection’s own refusal (PS-28). Read more
Source§fn id(&self) -> &ProjectionId
fn id(&self) -> &ProjectionId
The projection’s name: which read model this is, within
Self::Store. Read moreSource§async fn apply(
&mut self,
event: Delivered<Stock>,
batch: &mut MemoryProjectionBatch,
) -> Result<(), MemoryProjectionStoreError>
async fn apply( &mut self, event: Delivered<Stock>, batch: &mut MemoryProjectionBatch, ) -> Result<(), MemoryProjectionStoreError>
Applies one delivered event into the store’s open write set. Read more
Auto Trait Implementations§
impl Freeze for StockOnHand
impl RefUnwindSafe for StockOnHand
impl Send for StockOnHand
impl Sync for StockOnHand
impl Unpin for StockOnHand
impl UnsafeUnpin for StockOnHand
impl UnwindSafe for StockOnHand
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