pub struct Reduction<A> { /* private fields */ }Expand description
Describes the result of a successful LogManager::reduce operation.
This is what is stored in the ReductionCache. During subsequent
reductions, the LogManager only selects the events with indexes
higher than the through_index.
Implementations§
Source§impl<A> Reduction<A>
impl<A> Reduction<A>
Sourcepub fn reduced_at(&self) -> DateTime<Utc>
pub fn reduced_at(&self) -> DateTime<Utc>
Returns the wall-clock time at which the reduction occurred. This is for informational purposes only since the clocks on different service instances using this library might be skewed.
Sourcepub fn through_index(&self) -> u32
pub fn through_index(&self) -> u32
Returns the max event index included in the Aggregate.
Sourcepub fn log_state(&self) -> LogState
pub fn log_state(&self) -> LogState
Returns a LogState that can be passed to LogManager::append. Typically you don’t need to call this directly, and can instead just pass the Reduction itself to LogManager::append since it can be converted automatically into a LogState.
Trait Implementations§
Source§impl<'de, A> Deserialize<'de> for Reduction<A>where
A: Deserialize<'de>,
impl<'de, A> Deserialize<'de> for Reduction<A>where
A: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<A> From<Reduction<A>> for LogState
Converts a Reduction into a LogState by calling Reduction::log_state.
impl<A> From<Reduction<A>> for LogState
Converts a Reduction into a LogState by calling Reduction::log_state.
impl<A> StructuralPartialEq for Reduction<A>
Auto Trait Implementations§
impl<A> Freeze for Reduction<A>where
A: Freeze,
impl<A> RefUnwindSafe for Reduction<A>where
A: RefUnwindSafe,
impl<A> Send for Reduction<A>where
A: Send,
impl<A> Sync for Reduction<A>where
A: Sync,
impl<A> Unpin for Reduction<A>where
A: Unpin,
impl<A> UnwindSafe for Reduction<A>where
A: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more