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§

source§

impl<'a> DataOperator<'a>

source

pub fn to_string(&self) -> Result<String, StamError>

Turns the DataOperator to a string, compatible with STAMQL

Trait Implementations§

source§

impl<'a> Clone for DataOperator<'a>

source§

fn clone(&self) -> DataOperator<'a>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for DataOperator<'a>

source§

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

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

impl<'a> From<&'a DataValue> for DataOperator<'a>

source§

fn from(v: &'a DataValue) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a str> for DataOperator<'a>

source§

fn from(s: &'a str) -> Self

Converts to this type from the input type.
source§

impl<'a> From<DateTime<FixedOffset>> for DataOperator<'a>

source§

fn from(v: DateTime<FixedOffset>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<bool> for DataOperator<'a>

source§

fn from(v: bool) -> Self

Converts to this type from the input type.
source§

impl<'a> From<f64> for DataOperator<'a>

source§

fn from(v: f64) -> Self

Converts to this type from the input type.
source§

impl<'a> From<isize> for DataOperator<'a>

source§

fn from(v: isize) -> Self

Converts to this type from the input type.
source§

impl<'a> From<usize> for DataOperator<'a>

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl<'a> PartialEq for DataOperator<'a>

source§

fn eq(&self, other: &DataOperator<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> TryFrom<DataOperator<'a>> for DataValue

§

type Error = StamError

The type returned in the event of a conversion error.
source§

fn try_from(operator: DataOperator<'a>) -> Result<Self, Self::Error>

Performs the conversion.
source§

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> 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> 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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