pub struct StreamQuery<ID: EventId, E: Event + Clone> { /* private fields */ }Expand description
Represents a query for filtering event streams.
A StreamQuery is used to define filters and constraints for querying event streams.
It allows you to specify a filter to narrow down the events of interest and an origin
to determine the starting point of the query within the event stream.
Implementations§
Source§impl<ID: EventId, E: Event + Clone> StreamQuery<ID, E>
impl<ID: EventId, E: Event + Clone> StreamQuery<ID, E>
Sourcepub fn filters(&self) -> &[StreamFilter<ID, E>]
pub fn filters(&self) -> &[StreamFilter<ID, E>]
Returns the filter associated with the stream query, if any.
Sourcepub fn cast<U>(&self) -> StreamQuery<ID, U>
pub fn cast<U>(&self) -> StreamQuery<ID, U>
Casts the stream query to a different event type.
Sourcepub fn union<U, O>(&self, other: &StreamQuery<ID, O>) -> StreamQuery<ID, U>
pub fn union<U, O>(&self, other: &StreamQuery<ID, O>) -> StreamQuery<ID, U>
Unions two stream queries into a single query.
Sourcepub fn change_origin(self, origin: ID) -> Self
pub fn change_origin(self, origin: ID) -> Self
Changes the origin of the stream query.
The origin determines the starting point of the query within the event stream.
Sourcepub fn exclude_events(self, excluded_events: &'static [&'static str]) -> Self
pub fn exclude_events(self, excluded_events: &'static [&'static str]) -> Self
Excludes the specified events from the stream query.
The excluded events are not included in the query results.
Sourcepub fn matches(&self, event: &PersistedEvent<ID, E>) -> bool
pub fn matches(&self, event: &PersistedEvent<ID, E>) -> bool
Checks if the stream query matches the given event.
pub fn matches_event(&self, event: &str) -> bool
Trait Implementations§
Source§impl<ID: Clone + EventId, E: Clone + Event + Clone> Clone for StreamQuery<ID, E>
impl<ID: Clone + EventId, E: Clone + Event + Clone> Clone for StreamQuery<ID, E>
Source§fn clone(&self) -> StreamQuery<ID, E>
fn clone(&self) -> StreamQuery<ID, E>
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<ID, S, E: Event + Clone> From<&S> for StreamQuery<ID, E>where
S: StateQuery<Event = E>,
ID: EventId,
impl<ID, S, E: Event + Clone> From<&S> for StreamQuery<ID, E>where
S: StateQuery<Event = E>,
ID: EventId,
Auto Trait Implementations§
impl<ID, E> Freeze for StreamQuery<ID, E>
impl<ID, E> RefUnwindSafe for StreamQuery<ID, E>where
E: RefUnwindSafe,
ID: RefUnwindSafe,
impl<ID, E> Send for StreamQuery<ID, E>where
E: Send,
impl<ID, E> Sync for StreamQuery<ID, E>where
E: Sync,
impl<ID, E> Unpin for StreamQuery<ID, E>
impl<ID, E> UnwindSafe for StreamQuery<ID, E>where
E: UnwindSafe,
ID: 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
Mutably borrows from an owned value. Read more