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 duplicate of the value. Read more
1.0.0 (const: unstable) · 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 (const: unstable) · 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§fn eq(&self, other: &ValOpsFactory<I, F>) -> bool
fn eq(&self, other: &ValOpsFactory<I, F>) -> bool
Tests for
self and other values to be equal, and is used by ==.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> UnsafeUnpin 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