pub struct FilterSet { /* private fields */ }Expand description
Compiled filter set. patterns parses the raw Filters: [{Pattern: "..."}]
strings into JSON objects once at create time.
Implementations§
Source§impl FilterSet
impl FilterSet
Sourcepub fn from_strings<I, S>(raw: I) -> Self
pub fn from_strings<I, S>(raw: I) -> Self
Build from the raw filter pattern strings stored on
crate::state::EventSourceMapping::filter_patterns. Patterns
that fail to parse are logged and dropped; pre-validation at
Self::validate (called from CreateEventSourceMapping)
keeps the live data clean.
Sourcepub fn validate<I, S>(raw: I) -> Result<(), String>
pub fn validate<I, S>(raw: I) -> Result<(), String>
Validate raw filter patterns the same way real AWS rejects bad
FilterCriteria at CreateEventSourceMapping. Returns the
first invalid pattern’s parse error so the service can surface
it as InvalidParameterValueException.
Sourcepub fn matches(&self, record: &Value) -> bool
pub fn matches(&self, record: &Value) -> bool
Returns true when the record matches at least one pattern, or
when the filter set is empty (no filtering = pass-through).
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FilterSet
impl RefUnwindSafe for FilterSet
impl Send for FilterSet
impl Sync for FilterSet
impl Unpin for FilterSet
impl UnsafeUnpin for FilterSet
impl UnwindSafe for FilterSet
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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