pub struct ReadOptions {
pub lower_bound: LowerBound,
pub upper_bound: UpperBound,
pub order: Order,
}Expand description
Narrows down which events Store::read hands out, or
turns around the order it hands them out in. A read has one lower bound, one
upper bound, and one order, so options that contradict each other can not
be written.
The options are those of a read of EventSourcingDB, which they cover in full, so they are closed on purpose: a new option of the database comes with a new major version of the client SDK, and so of the kit:
use architecturekit::{LowerBound, Order, ReadOptions, Revision};
let next_page = ReadOptions {
lower_bound: LowerBound::AfterEvent(Revision::from(41)),
..ReadOptions::default()
};
let newest_first = ReadOptions {
order: Order::NewestFirst,
..ReadOptions::default()
};An ID of a bound is a Revision, so it is always the ID of an event, and
bounds that leave no room for an event make reading fail with
EmptyRange (see check_read_options).
Fields§
§lower_bound: LowerBoundWhere the events start, at the first one unless it says otherwise.
upper_bound: UpperBoundWhere the events end, at the last one unless it says otherwise.
order: OrderThe order of the events, oldest first unless it says otherwise.
Trait Implementations§
Source§impl Clone for ReadOptions
impl Clone for ReadOptions
Source§impl Debug for ReadOptions
impl Debug for ReadOptions
Source§impl Default for ReadOptions
impl Default for ReadOptions
impl Eq for ReadOptions
Source§impl PartialEq for ReadOptions
impl PartialEq for ReadOptions
impl StructuralPartialEq for ReadOptions
Auto Trait Implementations§
impl Freeze for ReadOptions
impl RefUnwindSafe for ReadOptions
impl Send for ReadOptions
impl Sync for ReadOptions
impl Unpin for ReadOptions
impl UnsafeUnpin for ReadOptions
impl UnwindSafe for ReadOptions
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request