Struct exmex::ValOpsFactory
source · [−]pub struct ValOpsFactory<I = i32, F = f64>where
I: DataType + PrimInt + Signed,
F: DataType + Float,{ /* private fields */ }
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
sourceimpl<I: Clone, F: Clone> Clone for ValOpsFactory<I, F>where
I: DataType + PrimInt + Signed,
F: DataType + Float,
impl<I: Clone, F: Clone> Clone for ValOpsFactory<I, F>where
I: DataType + PrimInt + Signed,
F: DataType + Float,
sourcefn clone(&self) -> ValOpsFactory<I, F>
fn clone(&self) -> ValOpsFactory<I, F>
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<I: Debug, F: Debug> Debug for ValOpsFactory<I, F>where
I: DataType + PrimInt + Signed,
F: DataType + Float,
impl<I: Debug, F: Debug> Debug for ValOpsFactory<I, F>where
I: DataType + PrimInt + Signed,
F: DataType + Float,
sourceimpl<I, F> MakeOperators<Val<I, F>> for ValOpsFactory<I, F>where
I: DataType + PrimInt + Signed,
F: DataType + Float,
<I as FromStr>::Err: Debug,
<F as FromStr>::Err: Debug,
impl<I, F> MakeOperators<Val<I, F>> for ValOpsFactory<I, F>where
I: DataType + PrimInt + Signed,
F: DataType + Float,
<I as FromStr>::Err: Debug,
<F as FromStr>::Err: Debug,
sourceimpl<I: Ord, F: Ord> Ord for ValOpsFactory<I, F>where
I: DataType + PrimInt + Signed,
F: DataType + Float,
impl<I: Ord, F: Ord> Ord for ValOpsFactory<I, F>where
I: DataType + PrimInt + Signed,
F: DataType + Float,
sourcefn cmp(&self, other: &ValOpsFactory<I, F>) -> Ordering
fn cmp(&self, other: &ValOpsFactory<I, F>) -> Ordering
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<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,
sourcefn eq(&self, other: &ValOpsFactory<I, F>) -> bool
fn eq(&self, other: &ValOpsFactory<I, F>) -> bool
sourceimpl<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,
sourcefn partial_cmp(&self, other: &ValOpsFactory<I, F>) -> Option<Ordering>
fn partial_cmp(&self, other: &ValOpsFactory<I, F>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more