pub struct EventPage {
pub events: Vec<StoredEvent>,
pub next_cursor: EventCursor,
}Expand description
One page of EventJournalReader::read_from.
next_cursor is where the following call must resume. It is the sequence of
the last event in events, or the cursor that was asked for when the page
is empty, so a consumer can store it unconditionally and never has to
reason about the empty case.
Fields§
§events: Vec<StoredEvent>The events, in sequence order, at most the requested limit.
next_cursor: EventCursorWhere to resume. Never goes backwards.
Implementations§
Source§impl EventPage
impl EventPage
Sourcepub fn new(events: Vec<StoredEvent>, asked: EventCursor) -> Self
pub fn new(events: Vec<StoredEvent>, asked: EventCursor) -> Self
A page holding events, resuming after the last of them or at asked
when there are none.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EventPage
impl<'de> Deserialize<'de> for EventPage
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EventPage
impl StructuralPartialEq for EventPage
Auto Trait Implementations§
impl Freeze for EventPage
impl RefUnwindSafe for EventPage
impl Send for EventPage
impl Sync for EventPage
impl Unpin for EventPage
impl UnsafeUnpin for EventPage
impl UnwindSafe for EventPage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.