Enum stam::DataOperator
source · pub enum DataOperator<'a> {
Show 26 variants
Null,
Any,
Equals(&'a str),
EqualsInt(isize),
EqualsFloat(f64),
True,
False,
GreaterThan(isize),
GreaterThanOrEqual(isize),
GreaterThanFloat(f64),
GreaterThanOrEqualFloat(f64),
LessThan(isize),
LessThanOrEqual(isize),
LessThanFloat(f64),
LessThanOrEqualFloat(f64),
ExactDatetime(DateTime<FixedOffset>),
AfterDatetime(DateTime<FixedOffset>),
BeforeDatetime(DateTime<FixedOffset>),
AtOrAfterDatetime(DateTime<FixedOffset>),
AtOrBeforeDatetime(DateTime<FixedOffset>),
HasElement(&'a str),
HasElementInt(isize),
HasElementFloat(f64),
Not(Box<DataOperator<'a>>),
And(Vec<DataOperator<'a>>),
Or(Vec<DataOperator<'a>>),
}Expand description
This type defines a test that can be done on a DataValue (via DataValue::test()).
The operator does not merely consist of the operator-part, but also holds the value that is tested against, which may
be one of various types, hence the many variants of this type.
DataOperator::Any is a special variant of this operator that will always pass.
Variants§
Null
Any
Equals(&'a str)
Tests against a string
EqualsInt(isize)
Tests against a numeric integer
EqualsFloat(f64)
Tests against a numeric floating-point value
True
False
GreaterThan(isize)
The datavalue must be numeric and greater than the value with the operator
GreaterThanOrEqual(isize)
The datavalue must be numeric and greater than or equal to the value with the operator
GreaterThanFloat(f64)
The datavalue must be numeric and greater than the value with the operator
GreaterThanOrEqualFloat(f64)
The datavalue must be numeric and greater than or equal to the value with the operator
LessThan(isize)
The datavalue must be numeric and less than the value with the operator
LessThanOrEqual(isize)
The datavalue must be numeric and less than or equal to the value with the operator
LessThanFloat(f64)
The datavalue must be numeric and less than or equal to the value with the operator
LessThanOrEqualFloat(f64)
The datavalue must be numeric and less than or equal to the value with the operator
ExactDatetime(DateTime<FixedOffset>)
The datavalue must be a datetime and match this reference exactly
AfterDatetime(DateTime<FixedOffset>)
The datavalue must be a datetime and come after this reference datetime
BeforeDatetime(DateTime<FixedOffset>)
The datavalue must be a datetime and come before this reference datetime
AtOrAfterDatetime(DateTime<FixedOffset>)
The datavalue must be a datetime and come at or after this reference datetime
AtOrBeforeDatetime(DateTime<FixedOffset>)
The datavalue must be a datetime and come at or before this reference datetime
HasElement(&'a str)
HasElementInt(isize)
HasElementFloat(f64)
Not(Box<DataOperator<'a>>)
Logical negation, reverses the operator
And(Vec<DataOperator<'a>>)
Logical AND operator (conjunction) to combine multiple operators into one
Or(Vec<DataOperator<'a>>)
Logical OR operator (disjunction) to combine multiple operators into one
Implementations§
Trait Implementations§
source§impl<'a> Clone for DataOperator<'a>
impl<'a> Clone for DataOperator<'a>
source§fn clone(&self) -> DataOperator<'a>
fn clone(&self) -> DataOperator<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<'a> Debug for DataOperator<'a>
impl<'a> Debug for DataOperator<'a>
source§impl<'a> From<&'a DataValue> for DataOperator<'a>
impl<'a> From<&'a DataValue> for DataOperator<'a>
source§impl<'a> From<&'a str> for DataOperator<'a>
impl<'a> From<&'a str> for DataOperator<'a>
source§impl<'a> From<DateTime<FixedOffset>> for DataOperator<'a>
impl<'a> From<DateTime<FixedOffset>> for DataOperator<'a>
source§fn from(v: DateTime<FixedOffset>) -> Self
fn from(v: DateTime<FixedOffset>) -> Self
source§impl<'a> From<bool> for DataOperator<'a>
impl<'a> From<bool> for DataOperator<'a>
source§impl<'a> From<f64> for DataOperator<'a>
impl<'a> From<f64> for DataOperator<'a>
source§impl<'a> From<isize> for DataOperator<'a>
impl<'a> From<isize> for DataOperator<'a>
source§impl<'a> From<usize> for DataOperator<'a>
impl<'a> From<usize> for DataOperator<'a>
source§impl<'a> PartialEq for DataOperator<'a>
impl<'a> PartialEq for DataOperator<'a>
source§fn eq(&self, other: &DataOperator<'a>) -> bool
fn eq(&self, other: &DataOperator<'a>) -> bool
self and other values to be equal, and is used
by ==.source§impl<'a> TryFrom<DataOperator<'a>> for DataValue
impl<'a> TryFrom<DataOperator<'a>> for DataValue
impl<'a> StructuralPartialEq for DataOperator<'a>
Auto Trait Implementations§
impl<'a> Freeze for DataOperator<'a>
impl<'a> RefUnwindSafe for DataOperator<'a>
impl<'a> Send for DataOperator<'a>
impl<'a> Sync for DataOperator<'a>
impl<'a> Unpin for DataOperator<'a>
impl<'a> UnwindSafe for DataOperator<'a>
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
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>
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>
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