pub struct Number<K, S = Root> { /* private fields */ }Expand description
A numeric field. K is the numeric kind (kind::Byte…kind::Decimal),
S the scope. Value operators accept any value of that kind — the matching
primitive, a losslessly-widening one (i32 on a Long/Double/Decimal
field), rust_decimal::Decimal (decimal feature, on a Decimal field), or
a #[derive(FlussoValue)] numeric newtype — so a custom money/quantity type
queries with no cast. A lossy value is a compile error (a float on an integer
field, an i64 on a Short).
Implementations§
Source§impl<K, S> Number<K, S>
impl<K, S> Number<K, S>
pub fn at(path: impl Into<String>) -> Self
Sourcepub fn eq(&self, value: impl FlussoValue<K>) -> EqQuery<S>
pub fn eq(&self, value: impl FlussoValue<K>) -> EqQuery<S>
Exact match.
Sourcepub fn any_of(
&self,
values: impl IntoIterator<Item = impl FlussoValue<K>>,
) -> TermsQuery<S>
pub fn any_of( &self, values: impl IntoIterator<Item = impl FlussoValue<K>>, ) -> TermsQuery<S>
Match any of the given values.
Sourcepub fn lt(&self, value: impl FlussoValue<K>) -> RangeQuery<S>
pub fn lt(&self, value: impl FlussoValue<K>) -> RangeQuery<S>
Strictly less than value.
Sourcepub fn lte(&self, value: impl FlussoValue<K>) -> RangeQuery<S>
pub fn lte(&self, value: impl FlussoValue<K>) -> RangeQuery<S>
Less than or equal to value.
Sourcepub fn gt(&self, value: impl FlussoValue<K>) -> RangeQuery<S>
pub fn gt(&self, value: impl FlussoValue<K>) -> RangeQuery<S>
Strictly greater than value.
Sourcepub fn gte(&self, value: impl FlussoValue<K>) -> RangeQuery<S>
pub fn gte(&self, value: impl FlussoValue<K>) -> RangeQuery<S>
Greater than or equal to value.
Sourcepub fn between(
&self,
low: impl FlussoValue<K>,
high: impl FlussoValue<K>,
) -> RangeQuery<S>
pub fn between( &self, low: impl FlussoValue<K>, high: impl FlussoValue<K>, ) -> RangeQuery<S>
Inclusive range [low, high].
pub fn asc(&self) -> Sort
pub fn desc(&self) -> Sort
Trait Implementations§
Auto Trait Implementations§
impl<K, S> Freeze for Number<K, S>
impl<K, S> RefUnwindSafe for Number<K, S>
impl<K, S> Send for Number<K, S>
impl<K, S> Sync for Number<K, S>
impl<K, S> Unpin for Number<K, S>
impl<K, S> UnsafeUnpin for Number<K, S>
impl<K, S> UnwindSafe for Number<K, S>
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