pub struct ParsedContentFilter { /* private fields */ }Expand description
Parsed version of the raw ContentFilter.
Implementations§
Source§impl ParsedContentFilter
impl ParsedContentFilter
Sourcepub fn evaluate(
&self,
item: impl AttributeQueryable,
type_tree: &dyn TypeTree,
) -> bool
pub fn evaluate( &self, item: impl AttributeQueryable, type_tree: &dyn TypeTree, ) -> bool
Evaluate the content filter, returning true if it
passes the filter.
Source§impl ParsedContentFilter
impl ParsedContentFilter
Sourcepub fn empty() -> ParsedContentFilter
pub fn empty() -> ParsedContentFilter
Create a new empty content filter.
Sourcepub fn parse(
filter: ContentFilter,
type_tree: &dyn TypeTree,
allow_attribute_operands: bool,
banned_operators: &[FilterOperator],
) -> (ContentFilterResult, Result<ParsedContentFilter, StatusCode>)
pub fn parse( filter: ContentFilter, type_tree: &dyn TypeTree, allow_attribute_operands: bool, banned_operators: &[FilterOperator], ) -> (ContentFilterResult, Result<ParsedContentFilter, StatusCode>)
Create a new content filter from the raw ContentFilter.
If allow_attribute_operands is false, parsing will fail
if it encounters an attribute operand.
banned_operators is a list of operators that are not allowed in the filter.
If any of these operators are present, the parsing will fail with
StatusCode::BadFilterOperatorUnsupported.
Trait Implementations§
Source§impl Clone for ParsedContentFilter
impl Clone for ParsedContentFilter
Source§fn clone(&self) -> ParsedContentFilter
fn clone(&self) -> ParsedContentFilter
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 moreAuto Trait Implementations§
impl Freeze for ParsedContentFilter
impl !RefUnwindSafe for ParsedContentFilter
impl Send for ParsedContentFilter
impl Sync for ParsedContentFilter
impl Unpin for ParsedContentFilter
impl UnsafeUnpin for ParsedContentFilter
impl !UnwindSafe for ParsedContentFilter
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