pub struct EntityEvents<T: EsEvent> {
pub entity_id: <T as EsEvent>::EntityId,
/* private fields */
}Fields§
§entity_id: <T as EsEvent>::EntityIdImplementations§
Source§impl<T> EntityEvents<T>where
T: EsEvent,
impl<T> EntityEvents<T>where
T: EsEvent,
pub fn init( id: <T as EsEvent>::EntityId, initial_events: impl IntoIterator<Item = T>, ) -> Self
pub fn id(&self) -> &<T as EsEvent>::EntityId
pub fn entity_first_persisted_at(&self) -> Option<DateTime<Utc>>
pub fn entity_last_modified_at(&self) -> Option<DateTime<Utc>>
pub fn push(&mut self, event: T)
pub fn mark_new_events_persisted_at( &mut self, recorded_at: DateTime<Utc>, ) -> usize
pub fn serialize_new_events(&self) -> Vec<Value>
pub fn any_new(&self) -> bool
pub fn len_persisted(&self) -> usize
pub fn iter_persisted( &self, ) -> impl DoubleEndedIterator<Item = &PersistedEvent<T>>
pub fn last_persisted(&self, n: usize) -> LastPersisted<'_, T>
pub fn iter_all(&self) -> impl DoubleEndedIterator<Item = &T>
pub fn load_first<E: EsEntity<Event = T>>( events: impl IntoIterator<Item = GenericEvent<<T as EsEvent>::EntityId>>, ) -> Result<E, EsEntityError>
pub fn load_n<E: EsEntity<Event = T>>( events: impl IntoIterator<Item = GenericEvent<<T as EsEvent>::EntityId>>, n: usize, ) -> Result<(Vec<E>, bool), EsEntityError>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for EntityEvents<T>
impl<T> RefUnwindSafe for EntityEvents<T>
impl<T> Send for EntityEvents<T>
impl<T> Sync for EntityEvents<T>
impl<T> Unpin for EntityEvents<T>
impl<T> UnwindSafe for EntityEvents<T>
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
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>
Converts
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>
Converts
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