pub struct WatchFilter {
pub domains: Option<Vec<String>>,
pub experience_types: Option<Vec<ExperienceType>>,
pub min_importance: Option<f32>,
}Expand description
Filter for narrowing which watch events a subscriber receives.
All fields are optional. When multiple fields are set, they are combined with AND logic: an event must match all specified criteria.
Filters are applied on the sender side before channel delivery, so subscribers only receive events they care about.
§Example
use pulsedb::WatchFilter;
let filter = WatchFilter {
domains: Some(vec!["security".to_string()]),
min_importance: Some(0.7),
..Default::default()
};
let stream = db.watch_experiences_filtered(collective_id, filter)?;Fields§
§domains: Option<Vec<String>>Only emit events for experiences in these domains.
If None, all domains match.
experience_types: Option<Vec<ExperienceType>>Only emit events for these experience types.
If None, all types match.
min_importance: Option<f32>Only emit events for experiences with importance >= this threshold.
If None, all importance levels match.
Trait Implementations§
Source§impl Clone for WatchFilter
impl Clone for WatchFilter
Source§fn clone(&self) -> WatchFilter
fn clone(&self) -> WatchFilter
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 WatchFilter
impl Debug for WatchFilter
Source§impl Default for WatchFilter
impl Default for WatchFilter
Source§fn default() -> WatchFilter
fn default() -> WatchFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WatchFilter
impl RefUnwindSafe for WatchFilter
impl Send for WatchFilter
impl Sync for WatchFilter
impl Unpin for WatchFilter
impl UnsafeUnpin for WatchFilter
impl UnwindSafe for WatchFilter
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<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>
Converts
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>
Converts
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 more