Struct exmex::ValOpsFactory
source · pub struct ValOpsFactory<I = i32, F = f64>{ /* 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§
source§impl<I, F> Clone for ValOpsFactory<I, F>
impl<I, F> Clone for ValOpsFactory<I, F>
source§fn clone(&self) -> ValOpsFactory<I, F>
fn clone(&self) -> ValOpsFactory<I, F>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<I, F> Debug for ValOpsFactory<I, F>
impl<I, F> Debug for ValOpsFactory<I, F>
source§impl<I, F> Default for ValOpsFactory<I, F>
impl<I, F> Default for ValOpsFactory<I, F>
source§fn default() -> ValOpsFactory<I, F>
fn default() -> ValOpsFactory<I, F>
Returns the “default value” for a type. Read more
source§impl<I, F> MakeOperators<Val<I, F>> for ValOpsFactory<I, F>
impl<I, F> MakeOperators<Val<I, F>> for ValOpsFactory<I, F>
source§impl<I, F> Ord for ValOpsFactory<I, F>
impl<I, F> Ord for ValOpsFactory<I, F>
source§fn cmp(&self, other: &ValOpsFactory<I, F>) -> Ordering
fn cmp(&self, other: &ValOpsFactory<I, F>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<I, F> PartialEq for ValOpsFactory<I, F>
impl<I, F> PartialEq for ValOpsFactory<I, F>
source§impl<I, F> PartialOrd for ValOpsFactory<I, F>
impl<I, F> PartialOrd for ValOpsFactory<I, F>
impl<I, F> Eq for ValOpsFactory<I, F>
impl<I, F> StructuralPartialEq for ValOpsFactory<I, F>
Auto Trait Implementations§
impl<I, F> Freeze for ValOpsFactory<I, F>
impl<I, F> RefUnwindSafe for ValOpsFactory<I, F>where
I: RefUnwindSafe,
F: RefUnwindSafe,
impl<I, F> Send for ValOpsFactory<I, F>
impl<I, F> Sync for ValOpsFactory<I, F>
impl<I, F> Unpin for ValOpsFactory<I, F>
impl<I, F> UnwindSafe for ValOpsFactory<I, F>where
I: UnwindSafe,
F: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)