pub struct QueryOptions { /* private fields */ }Expand description
Options for configuring event queries.
Use the builder-style methods to configure direction and limits.
§Example
use evidentsource_core::domain::{QueryDirection, QueryOptions};
// Default options (forward, no limit)
let opts = QueryOptions::default();
// Get first 100 events in reverse order
let opts = QueryOptions::new()
.direction(QueryDirection::Reverse)
.limit(100);
// Shorthand for reverse
let opts = QueryOptions::new().reverse().limit(50);Implementations§
Source§impl QueryOptions
impl QueryOptions
Sourcepub fn new() -> QueryOptions
pub fn new() -> QueryOptions
Create new query options with default values.
Sourcepub fn direction(self, direction: QueryDirection) -> QueryOptions
pub fn direction(self, direction: QueryDirection) -> QueryOptions
Set the query direction.
Sourcepub fn forward(self) -> QueryOptions
pub fn forward(self) -> QueryOptions
Set the direction to forward (oldest to newest).
Sourcepub fn reverse(self) -> QueryOptions
pub fn reverse(self) -> QueryOptions
Set the direction to reverse (newest to oldest).
Sourcepub fn limit(self, limit: u64) -> QueryOptions
pub fn limit(self, limit: u64) -> QueryOptions
Set the maximum number of results to return.
Sourcepub fn get_direction(&self) -> QueryDirection
pub fn get_direction(&self) -> QueryDirection
Get the configured direction.
Trait Implementations§
Source§impl Clone for QueryOptions
impl Clone for QueryOptions
Source§fn clone(&self) -> QueryOptions
fn clone(&self) -> QueryOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryOptions
impl Debug for QueryOptions
Source§impl Default for QueryOptions
impl Default for QueryOptions
Source§fn default() -> QueryOptions
fn default() -> QueryOptions
Returns the “default value” for a type. Read more
Source§impl Hash for QueryOptions
impl Hash for QueryOptions
Source§impl PartialEq for QueryOptions
impl PartialEq for QueryOptions
impl Copy for QueryOptions
impl Eq for QueryOptions
impl StructuralPartialEq for QueryOptions
Auto Trait Implementations§
impl Freeze for QueryOptions
impl RefUnwindSafe for QueryOptions
impl Send for QueryOptions
impl Sync for QueryOptions
impl Unpin for QueryOptions
impl UnwindSafe for QueryOptions
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<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.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
Compare self to
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request