Enum tc_value::NumberType
source · [−]pub enum NumberType {
Bool,
Complex(ComplexType),
Float(FloatType),
Int(IntType),
UInt(UIntType),
Number,
}
Expand description
The type of a generic Number
.
Variants
Bool
Complex(ComplexType)
Float(FloatType)
Int(IntType)
UInt(UIntType)
Number
Implementations
sourceimpl NumberType
impl NumberType
pub fn uint64() -> NumberType
Trait Implementations
sourceimpl Clone for NumberType
impl Clone for NumberType
sourcefn clone(&self) -> NumberType
fn clone(&self) -> NumberType
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 NumberType
impl Debug for NumberType
sourceimpl Default for NumberType
impl Default for NumberType
sourcefn default() -> NumberType
fn default() -> NumberType
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for NumberType
impl<'de> Deserialize<'de> for NumberType
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<NumberType, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<NumberType, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for NumberType
impl Display for NumberType
sourceimpl From<BooleanType> for NumberType
impl From<BooleanType> for NumberType
sourcefn from(_bt: BooleanType) -> NumberType
fn from(_bt: BooleanType) -> NumberType
Converts to this type from the input type.
sourceimpl From<ComplexType> for NumberType
impl From<ComplexType> for NumberType
sourcefn from(ct: ComplexType) -> NumberType
fn from(ct: ComplexType) -> NumberType
Converts to this type from the input type.
sourceimpl From<FloatType> for NumberType
impl From<FloatType> for NumberType
sourcefn from(ft: FloatType) -> NumberType
fn from(ft: FloatType) -> NumberType
Converts to this type from the input type.
sourceimpl From<IntType> for NumberType
impl From<IntType> for NumberType
sourcefn from(it: IntType) -> NumberType
fn from(it: IntType) -> NumberType
Converts to this type from the input type.
sourceimpl From<NumberType> for ValueType
impl From<NumberType> for ValueType
sourcefn from(nt: NumberType) -> ValueType
fn from(nt: NumberType) -> ValueType
Converts to this type from the input type.
sourceimpl From<UIntType> for NumberType
impl From<UIntType> for NumberType
sourcefn from(ut: UIntType) -> NumberType
fn from(ut: UIntType) -> NumberType
Converts to this type from the input type.
sourceimpl Hash for NumberType
impl Hash for NumberType
sourceimpl NumberClass for NumberType
impl NumberClass for NumberType
type Instance = Number
sourcefn is_complex(&self) -> bool
fn is_complex(&self) -> bool
Return true
if this is a complex type.
sourceimpl Ord for NumberType
impl Ord for NumberType
sourceimpl PartialEq<NumberType> for NumberType
impl PartialEq<NumberType> for NumberType
sourcefn eq(&self, other: &NumberType) -> bool
fn eq(&self, other: &NumberType) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &NumberType) -> bool
fn ne(&self, other: &NumberType) -> bool
This method tests for !=
.
sourceimpl PartialOrd<NumberType> for NumberType
impl PartialOrd<NumberType> for NumberType
sourcefn partial_cmp(&self, other: &NumberType) -> Option<Ordering>
fn partial_cmp(&self, other: &NumberType) -> 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 Serialize for NumberType
impl Serialize for NumberType
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl TryFrom<ValueType> for NumberType
impl TryFrom<ValueType> for NumberType
impl Copy for NumberType
impl Eq for NumberType
impl StructuralEq for NumberType
impl StructuralPartialEq for NumberType
Auto Trait Implementations
impl RefUnwindSafe for NumberType
impl Send for NumberType
impl Sync for NumberType
impl Unpin for NumberType
impl UnwindSafe for NumberType
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<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
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
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T)
if self
can be cast into T
, otherwise None
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.