Skip to main content

FieldRef

Struct FieldRef 

Source
pub struct FieldRef(/* private fields */);
Expand description

FieldRef

Zero-cost wrapper around a static field name used in predicates. Enables method-based predicate builders without allocating. Carries only a &'static str; use as_str or AsRef<str> to borrow it.

Implementations§

Source§

impl FieldRef

Source

pub const fn new(name: &'static str) -> Self

Create a new field reference.

Source

pub const fn as_str(self) -> &'static str

Return the underlying field name.

Source

pub fn eq(self, value: impl Into<FilterValue>) -> FilterExpr

Strict equality comparison (no coercion).

Source

pub fn text_eq_ci(self, value: impl Into<FilterValue>) -> FilterExpr

Case-insensitive equality for text fields.

Source

pub fn ne(self, value: impl Into<FilterValue>) -> FilterExpr

Strict inequality comparison.

Source

pub fn lt(self, value: impl Into<FilterValue>) -> FilterExpr

Less-than comparison with numeric widening.

Source

pub fn lte(self, value: impl Into<FilterValue>) -> FilterExpr

Less-than-or-equal comparison with numeric widening.

Source

pub fn gt(self, value: impl Into<FilterValue>) -> FilterExpr

Greater-than comparison with numeric widening.

Source

pub fn gte(self, value: impl Into<FilterValue>) -> FilterExpr

Greater-than-or-equal comparison with numeric widening.

Source

pub fn eq_field(self, other: impl AsRef<str>) -> FilterExpr

Strict equality comparison against another field.

Source

pub fn ne_field(self, other: impl AsRef<str>) -> FilterExpr

Strict inequality comparison against another field.

Source

pub fn lt_field(self, other: impl AsRef<str>) -> FilterExpr

Less-than comparison against another numeric or text field.

Source

pub fn lte_field(self, other: impl AsRef<str>) -> FilterExpr

Less-than-or-equal comparison against another numeric or text field.

Source

pub fn gt_field(self, other: impl AsRef<str>) -> FilterExpr

Greater-than comparison against another numeric or text field.

Source

pub fn gte_field(self, other: impl AsRef<str>) -> FilterExpr

Greater-than-or-equal comparison against another numeric or text field.

Source

pub fn in_list<I, V>(self, values: I) -> FilterExpr
where I: IntoIterator<Item = V>, V: Into<FilterValue>,

Membership test against a fixed list (strict).

Source

pub fn is_null(self) -> FilterExpr

Field is present and explicitly null.

Source

pub fn is_not_null(self) -> FilterExpr

Field is present and not null.

Source

pub fn is_missing(self) -> FilterExpr

Field is not present at all.

Source

pub fn is_empty(self) -> FilterExpr

Field is present but empty (collection- or string-specific).

Source

pub fn is_not_empty(self) -> FilterExpr

Field is present and non-empty.

Source

pub fn text_contains(self, value: impl Into<FilterValue>) -> FilterExpr

Case-sensitive substring match for text fields.

Source

pub fn text_contains_ci(self, value: impl Into<FilterValue>) -> FilterExpr

Case-insensitive substring match for text fields.

Source

pub fn text_starts_with(self, value: impl Into<FilterValue>) -> FilterExpr

Case-sensitive prefix match for text fields.

Source

pub fn text_starts_with_ci(self, value: impl Into<FilterValue>) -> FilterExpr

Case-insensitive prefix match for text fields.

Source

pub fn between( self, lower: impl Into<FilterValue>, upper: impl Into<FilterValue>, ) -> FilterExpr

Inclusive range predicate lowered as field >= lower AND field <= upper.

Source

pub fn between_fields( self, lower: impl AsRef<str>, upper: impl AsRef<str>, ) -> FilterExpr

Inclusive range predicate against two other fields.

Source

pub fn not_between( self, lower: impl Into<FilterValue>, upper: impl Into<FilterValue>, ) -> FilterExpr

Exclusive-outside range predicate lowered as field < lower OR field > upper.

Source

pub fn not_between_fields( self, lower: impl AsRef<str>, upper: impl AsRef<str>, ) -> FilterExpr

Exclusive-outside range predicate against two other fields.

Trait Implementations§

Source§

impl AsRef<str> for FieldRef

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for FieldRef

Source§

fn clone(&self) -> FieldRef

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for FieldRef

Source§

impl Eq for FieldRef

Source§

impl From<FieldRef> for OrderExpr

Source§

fn from(value: FieldRef) -> Self

Converts to this type from the input type.
Source§

impl Hash for FieldRef

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FieldRef

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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.
Source§

impl StructuralPartialEq for FieldRef

Auto Trait Implementations§

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> Casing<T> for T
where T: AsRef<str>,

Source§

fn to_case(&self, case: Case<'_>) -> String

Convert the string into the given case. It will reference self and create a new String with the same pattern and delimiter as case. It will split on boundaries defined at Boundary::defaults(). Read more
Source§

fn set_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>

Creates a StateConverter struct initialized with the boundaries provided. Read more
Source§

fn remove_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>

Creates a StateConverter struct initialized without the boundaries provided. Read more
Source§

fn from_case(&self, case: Case<'_>) -> StateConverter<'_, T>

Start the case conversion by storing the boundaries associated with the given case. Read more
Source§

fn remove_empty(&self) -> StateConverter<'_, T>

Creates a StateConverter with the RemoveEmpty pattern prepended. This filters out empty words before conversion, useful when splitting produces empty words from leading, trailing, and duplicate delimiters. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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