Enum AST

Source
pub enum AST<P> {
Show 15 variants Equals { field: P, value: Value, }, NotEquals { field: P, value: Value, }, In { field: P, value: Value, }, Contains { field: P, value: Value, }, GreaterThan { field: P, value: Value, }, LessThan { field: P, value: Value, }, GreaterThanOrEqual { field: P, value: Value, }, LessThanOrEqual { field: P, value: Value, }, StartsWith { field: P, value: Value, }, EndsWith { field: P, value: Value, }, RegexMatch { field: P, value: Value, }, InvalidField { field_name: String, }, And(Box<AST<P>>, Box<AST<P>>), Or(Box<AST<P>>, Box<AST<P>>), Not(Box<AST<P>>),
}
Expand description

An enumeration of Abstract Syntax Tree (AST) nodes representing various query operations. P: The generic type parameter representing the field type in the AST.

Variants§

§

Equals

Represents an equality operation: field == value.

Fields

§field: P
§value: Value
§

NotEquals

Represents an inequality operation: field != value.

Fields

§field: P
§value: Value
§

In

Represents a containment operation: field in value.

Fields

§field: P
§value: Value
§

Contains

Represents a containment operation: field contains value.

Fields

§field: P
§value: Value
§

GreaterThan

Represents a greater-than operation: field > value.

Fields

§field: P
§value: Value
§

LessThan

Represents a less-than operation: field < value.

Fields

§field: P
§value: Value
§

GreaterThanOrEqual

Represents a greater-than-or-equal-to operation: field >= value.

Fields

§field: P
§value: Value
§

LessThanOrEqual

Represents a less-than-or-equal-to operation: field <= value.

Fields

§field: P
§value: Value
§

StartsWith

Represents a starts-with operation: field starts with value.

Fields

§field: P
§value: Value
§

EndsWith

Represents an ends-with operation: field ends with value.

Fields

§field: P
§value: Value
§

RegexMatch

Represents a regex-match operation: field matches regex pattern.

Fields

§field: P
§value: Value
§

InvalidField

Fields

§field_name: String
§

And(Box<AST<P>>, Box<AST<P>>)

Represents a logical AND operation between two AST nodes.

§

Or(Box<AST<P>>, Box<AST<P>>)

Represents a logical OR operation between two AST nodes.

§

Not(Box<AST<P>>)

Implementations§

Source§

impl<P> AST<P>

Source

pub fn apply<F: StructMatcher<P> + Clone>(&self, items: &[F]) -> Vec<F>

Trait Implementations§

Source§

impl<P: Clone> Clone for AST<P>

Source§

fn clone(&self) -> AST<P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug> Debug for AST<P>

Source§

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

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

impl<P: PartialEq> PartialEq for AST<P>

Source§

fn eq(&self, other: &AST<P>) -> bool

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

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

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

impl<P> StructuralPartialEq for AST<P>

Auto Trait Implementations§

§

impl<P> Freeze for AST<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for AST<P>
where P: RefUnwindSafe,

§

impl<P> Send for AST<P>
where P: Send,

§

impl<P> Sync for AST<P>
where P: Sync,

§

impl<P> Unpin for AST<P>
where P: Unpin,

§

impl<P> UnwindSafe for AST<P>
where P: 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> 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.