Enum rant::RantNumber
source · [−]Expand description
Represents a dynamically-typed Rant number.
Implements TryFromRant
and can therefore be used on native functions to accept any number type (int
or float
),
while preserving the original type.
Variants
Int(i64)
Rant int
value.
Float(f64)
Rant float
value.
Trait Implementations
sourceimpl Clone for RantNumber
impl Clone for RantNumber
sourcefn clone(&self) -> RantNumber
fn clone(&self) -> RantNumber
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RantNumber
impl Debug for RantNumber
sourceimpl PartialEq<RantNumber> for RantNumber
impl PartialEq<RantNumber> for RantNumber
sourcefn eq(&self, other: &RantNumber) -> bool
fn eq(&self, other: &RantNumber) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RantNumber) -> bool
fn ne(&self, other: &RantNumber) -> bool
This method tests for !=
.
sourceimpl PartialOrd<RantNumber> for RantNumber
impl PartialOrd<RantNumber> for RantNumber
sourcefn partial_cmp(&self, other: &RantNumber) -> Option<Ordering>
fn partial_cmp(&self, other: &RantNumber) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
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 more
sourceimpl TryFromRant for RantNumber
impl TryFromRant for RantNumber
sourcefn try_from_rant(val: RantValue) -> Result<Self, ValueError>
fn try_from_rant(val: RantValue) -> Result<Self, ValueError>
Convert from a RantValue
.
sourcefn is_optional_param_type() -> bool
fn is_optional_param_type() -> bool
Returns true
if the type can be used to represent an optional Rant parameter in native functions; otherwise, false
.
impl Copy for RantNumber
impl StructuralPartialEq for RantNumber
Auto Trait Implementations
impl RefUnwindSafe for RantNumber
impl Send for RantNumber
impl Sync for RantNumber
impl Unpin for RantNumber
impl UnwindSafe for RantNumber
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more