pub enum RantNumber {
Int(i64),
Float(f64),
}
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§
Trait Implementations§
Source§impl Clone for RantNumber
impl Clone for RantNumber
Source§fn clone(&self) -> RantNumber
fn clone(&self) -> RantNumber
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 Debug for RantNumber
impl Debug for RantNumber
Source§impl PartialEq for RantNumber
impl PartialEq for RantNumber
Source§impl PartialOrd for RantNumber
impl PartialOrd for RantNumber
Source§impl TryFromRant for RantNumber
impl TryFromRant for RantNumber
Source§fn try_from_rant(val: RantValue) -> Result<Self, ValueError>
fn try_from_rant(val: RantValue) -> Result<Self, ValueError>
Convert from a
RantValue
.Source§fn 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 Freeze for RantNumber
impl RefUnwindSafe for RantNumber
impl Send for RantNumber
impl Sync for RantNumber
impl Unpin for RantNumber
impl UnwindSafe for RantNumber
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