Struct exmex::ValOpsFactory [−][src]
pub struct ValOpsFactory<I = i32, F = f64> where
I: DataType + PrimInt + Signed,
F: DataType + Float, { /* fields omitted */ }
Expand description
feature = "value"
- Factory of default operators for the data type Val
.
Operators available in addition to those from FloatOpsFactory
are:
representation | description |
---|---|
% | reminder of integers |
| | bitwise or of integers |
& | bitwise and of integers |
XOR | bitwise exclusive or of integers |
<< | left shift of integers |
>> | right shift of integers |
|| | or for booleans |
&& | and for booleans |
if | returns first operand if second is true, else Val::None , to make x if condition else y possible |
else | returns second operand if first is Val::None , else first, to make x if condition else y possible |
== , != , < , > , <= , >= | comparison operators between numbers, e.g., 1 == 1.0 is true. Comparing booleans to none-booleans is false, e.g., 1 == true is false. Comparisons with Val::None or Val::Error always results in false , e.g., (5 if false) == (5 if false) is false. |
fact | factorial of integers |
to_float | convert integer, float, or bool to float |
to_int | convert integer, float, or bool to integer |
Trait Implementations
impl<I: PartialEq, F: PartialEq> PartialEq<ValOpsFactory<I, F>> for ValOpsFactory<I, F> where
I: DataType + PrimInt + Signed,
F: DataType + Float,
impl<I: PartialEq, F: PartialEq> PartialEq<ValOpsFactory<I, F>> for ValOpsFactory<I, F> where
I: DataType + PrimInt + Signed,
F: DataType + Float,
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<I: PartialOrd, F: PartialOrd> PartialOrd<ValOpsFactory<I, F>> for ValOpsFactory<I, F> where
I: DataType + PrimInt + Signed,
F: DataType + Float,
impl<I: PartialOrd, F: PartialOrd> PartialOrd<ValOpsFactory<I, F>> for ValOpsFactory<I, F> where
I: DataType + PrimInt + Signed,
F: DataType + Float,
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl<I: Eq, F: Eq> Eq for ValOpsFactory<I, F> where
I: DataType + PrimInt + Signed,
F: DataType + Float,
impl<I, F> StructuralEq for ValOpsFactory<I, F> where
I: DataType + PrimInt + Signed,
F: DataType + Float,
impl<I, F> StructuralPartialEq for ValOpsFactory<I, F> where
I: DataType + PrimInt + Signed,
F: DataType + Float,
Auto Trait Implementations
impl<I, F> RefUnwindSafe for ValOpsFactory<I, F> where
F: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, F> Send for ValOpsFactory<I, F> where
F: Send,
I: Send,
impl<I, F> Sync for ValOpsFactory<I, F> where
F: Sync,
I: Sync,
impl<I, F> Unpin for ValOpsFactory<I, F> where
F: Unpin,
I: Unpin,
impl<I, F> UnwindSafe for ValOpsFactory<I, F> where
F: UnwindSafe,
I: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more