Skip to main content

StockOnHand

Struct StockOnHand 

Source
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§

Source§

impl ConvergentProjection for StockOnHand

Source§

impl Debug for StockOnHand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Projection for StockOnHand

Source§

type Event = Stock

The application’s own event enum. Not Bytes: the runner decodes.
Source§

type Store = MemoryProjectionStore

The store this read model and its checkpoint live in.
Source§

type Error = MemoryProjectionStoreError

The projection’s own refusal (PS-28). Read more
Source§

fn id(&self) -> &ProjectionId

The projection’s name: which read model this is, within Self::Store. Read more
Source§

fn scope(&self) -> &Tags

The tags this projection is scoped to, already validated. Read more
Source§

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
Source§

fn on_error( &mut self, failure: &ApplyFailure<'_, Self::Error>, batch: &mut <Self::Store as ProjectionStore>::Batch, ) -> impl Future<Output = Result<Policy, Self::Error>>

Decides what happens to an event that could not be decoded or applied. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V