Skip to main content

StreamQuery

Struct StreamQuery 

Source
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>

Source

pub fn filters(&self) -> &[StreamFilter<ID, E>]

Returns the filter associated with the stream query, if any.

Source

pub fn cast<U>(&self) -> StreamQuery<ID, U>
where E: Event + Into<U>, U: Event + Clone,

Casts the stream query to a different event type.

Source

pub fn union<U, O>(&self, other: &StreamQuery<ID, O>) -> StreamQuery<ID, U>
where E: Event + Into<U>, U: Event + Clone, O: Event + Into<U> + Clone,

Unions two stream queries into a single query.

Source

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.

Source

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.

Source

pub fn matches(&self, event: &PersistedEvent<ID, E>) -> bool

Checks if the stream query matches the given event.

Source

pub fn matches_event(&self, event: &str) -> bool

Trait Implementations§

Source§

impl<ID: Clone + EventId, E: Clone + Event + Clone> Clone for StreamQuery<ID, E>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<ID: Debug + EventId, E: Debug + Event + Clone> Debug for StreamQuery<ID, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<ID, S, E: Event + Clone> From<&S> for StreamQuery<ID, E>
where S: StateQuery<Event = E>, ID: EventId,

Source§

fn from(state: &S) -> Self

Converts to this type from the input type.
Source§

impl<ID: EventId, E: Event + Clone + PartialEq> PartialEq for StreamQuery<ID, E>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<ID, E> Freeze for StreamQuery<ID, E>

§

impl<ID, E> RefUnwindSafe for StreamQuery<ID, E>

§

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>
where E: Unpin, ID: Unpin,

§

impl<ID, E> UnwindSafe for StreamQuery<ID, E>
where E: UnwindSafe, ID: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V