Enum koto_runtime::KNumber

source ·
pub enum KNumber {
    F64(f64),
    I64(i64),
}
Expand description

The Number type used by the Koto runtime

The number can be either an f64 or an i64 depending on usage.

Variants§

§

F64(f64)

§

I64(i64)

Implementations§

source§

impl KNumber

source

pub fn abs(self) -> Self

Returns the absolute value of the number

source

pub fn ceil(self) -> Self

Returns the smallest integer greater than or equal to the number

source

pub fn floor(self) -> Self

Returns the largest integer less than or equal to the number

source

pub fn round(self) -> Self

Returns the integer closest to the number

Half-way values get rounded away from zero.

source

pub fn is_f64(self) -> bool

Returns true if the number is represented by an f64

source

pub fn is_i64(self) -> bool

Returns true if the number is represented by an i64

source

pub fn is_i64_in_f64_range(&self) -> bool

Returns true if the integer version of the number is representable by an f64

source

pub fn is_finite(self) -> bool

Returns true if the number is not NaN or infinity

source

pub fn is_nan(self) -> bool

Returns true if the number is NaN

source

pub fn pow(self, other: Self) -> Self

Returns the result of raising self to the power of other

If both inputs are i64s then the result will also be an i64, otherwise the result will be an f64.

source

pub fn to_bits(self) -> u64

Returns the value transmuted to a u64

source

pub fn as_i64(self) -> i64

Returns the number as an i64, calling floor if the number is an f64

Trait Implementations§

source§

impl Add for &KNumber

§

type Output = KNumber

The resulting type after applying the + operator.
source§

fn add(self, other: &KNumber) -> KNumber

Performs the + operation. Read more
source§

impl Add for KNumber

§

type Output = KNumber

The resulting type after applying the + operator.
source§

fn add(self, other: KNumber) -> KNumber

Performs the + operation. Read more
source§

impl Clone for KNumber

source§

fn clone(&self) -> KNumber

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for KNumber

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for KNumber

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div for &KNumber

§

type Output = KNumber

The resulting type after applying the / operator.
source§

fn div(self, other: &KNumber) -> KNumber

Performs the / operation. Read more
source§

impl Div for KNumber

§

type Output = KNumber

The resulting type after applying the / operator.
source§

fn div(self, other: KNumber) -> KNumber

Performs the / operation. Read more
source§

impl From<&KNumber> for f32

source§

fn from(n: &KNumber) -> f32

Converts to this type from the input type.
source§

impl From<&KNumber> for f64

source§

fn from(n: &KNumber) -> f64

Converts to this type from the input type.
source§

impl From<&KNumber> for i32

source§

fn from(n: &KNumber) -> i32

Converts to this type from the input type.
source§

impl From<&KNumber> for i64

source§

fn from(n: &KNumber) -> i64

Converts to this type from the input type.
source§

impl From<&KNumber> for isize

source§

fn from(n: &KNumber) -> isize

Converts to this type from the input type.
source§

impl From<&KNumber> for u32

source§

fn from(n: &KNumber) -> u32

Converts to this type from the input type.
source§

impl From<&KNumber> for u64

source§

fn from(n: &KNumber) -> u64

Converts to this type from the input type.
source§

impl From<&KNumber> for usize

source§

fn from(n: &KNumber) -> usize

Converts to this type from the input type.
source§

impl From<&f32> for KNumber

source§

fn from(n: &f32) -> KNumber

Converts to this type from the input type.
source§

impl From<&f64> for KNumber

source§

fn from(n: &f64) -> KNumber

Converts to this type from the input type.
source§

impl From<&i16> for KNumber

source§

fn from(n: &i16) -> KNumber

Converts to this type from the input type.
source§

impl From<&i32> for KNumber

source§

fn from(n: &i32) -> KNumber

Converts to this type from the input type.
source§

impl From<&i64> for KNumber

source§

fn from(n: &i64) -> KNumber

Converts to this type from the input type.
source§

impl From<&i8> for KNumber

source§

fn from(n: &i8) -> KNumber

Converts to this type from the input type.
source§

impl From<&isize> for KNumber

source§

fn from(n: &isize) -> KNumber

Converts to this type from the input type.
source§

impl From<&u16> for KNumber

source§

fn from(n: &u16) -> KNumber

Converts to this type from the input type.
source§

impl From<&u32> for KNumber

source§

fn from(n: &u32) -> KNumber

Converts to this type from the input type.
source§

impl From<&u64> for KNumber

source§

fn from(n: &u64) -> KNumber

Converts to this type from the input type.
source§

impl From<&u8> for KNumber

source§

fn from(n: &u8) -> KNumber

Converts to this type from the input type.
source§

impl From<&usize> for KNumber

source§

fn from(n: &usize) -> KNumber

Converts to this type from the input type.
source§

impl From<KNumber> for KValue

source§

fn from(value: KNumber) -> Self

Converts to this type from the input type.
source§

impl From<KNumber> for f32

source§

fn from(n: KNumber) -> f32

Converts to this type from the input type.
source§

impl From<KNumber> for f64

source§

fn from(n: KNumber) -> f64

Converts to this type from the input type.
source§

impl From<KNumber> for i32

source§

fn from(n: KNumber) -> i32

Converts to this type from the input type.
source§

impl From<KNumber> for i64

source§

fn from(n: KNumber) -> i64

Converts to this type from the input type.
source§

impl From<KNumber> for isize

source§

fn from(n: KNumber) -> isize

Converts to this type from the input type.
source§

impl From<KNumber> for u32

source§

fn from(n: KNumber) -> u32

Converts to this type from the input type.
source§

impl From<KNumber> for u64

source§

fn from(n: KNumber) -> u64

Converts to this type from the input type.
source§

impl From<KNumber> for usize

source§

fn from(n: KNumber) -> usize

Converts to this type from the input type.
source§

impl From<f32> for KNumber

source§

fn from(n: f32) -> KNumber

Converts to this type from the input type.
source§

impl From<f64> for KNumber

source§

fn from(n: f64) -> KNumber

Converts to this type from the input type.
source§

impl From<i16> for KNumber

source§

fn from(n: i16) -> KNumber

Converts to this type from the input type.
source§

impl From<i32> for KNumber

source§

fn from(n: i32) -> KNumber

Converts to this type from the input type.
source§

impl From<i64> for KNumber

source§

fn from(n: i64) -> KNumber

Converts to this type from the input type.
source§

impl From<i8> for KNumber

source§

fn from(n: i8) -> KNumber

Converts to this type from the input type.
source§

impl From<isize> for KNumber

source§

fn from(n: isize) -> KNumber

Converts to this type from the input type.
source§

impl From<u16> for KNumber

source§

fn from(n: u16) -> KNumber

Converts to this type from the input type.
source§

impl From<u32> for KNumber

source§

fn from(n: u32) -> KNumber

Converts to this type from the input type.
source§

impl From<u64> for KNumber

source§

fn from(n: u64) -> KNumber

Converts to this type from the input type.
source§

impl From<u8> for KNumber

source§

fn from(n: u8) -> KNumber

Converts to this type from the input type.
source§

impl From<usize> for KNumber

source§

fn from(n: usize) -> KNumber

Converts to this type from the input type.
source§

impl Hash for KNumber

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul for &KNumber

§

type Output = KNumber

The resulting type after applying the * operator.
source§

fn mul(self, other: &KNumber) -> KNumber

Performs the * operation. Read more
source§

impl Mul for KNumber

§

type Output = KNumber

The resulting type after applying the * operator.
source§

fn mul(self, other: KNumber) -> KNumber

Performs the * operation. Read more
source§

impl Neg for &KNumber

§

type Output = KNumber

The resulting type after applying the - operator.
source§

fn neg(self) -> KNumber

Performs the unary - operation. Read more
source§

impl Neg for KNumber

§

type Output = KNumber

The resulting type after applying the - operator.
source§

fn neg(self) -> KNumber

Performs the unary - operation. Read more
source§

impl Ord for KNumber

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<f32> for KNumber

source§

fn eq(&self, b: &f32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<f64> for KNumber

source§

fn eq(&self, b: &f64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i16> for KNumber

source§

fn eq(&self, b: &i16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i32> for KNumber

source§

fn eq(&self, b: &i32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i64> for KNumber

source§

fn eq(&self, b: &i64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i8> for KNumber

source§

fn eq(&self, b: &i8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<isize> for KNumber

source§

fn eq(&self, b: &isize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u16> for KNumber

source§

fn eq(&self, b: &u16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u32> for KNumber

source§

fn eq(&self, b: &u32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u64> for KNumber

source§

fn eq(&self, b: &u64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u8> for KNumber

source§

fn eq(&self, b: &u8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<usize> for KNumber

source§

fn eq(&self, b: &usize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for KNumber

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<f32> for KNumber

source§

fn partial_cmp(&self, b: &f32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<f64> for KNumber

source§

fn partial_cmp(&self, b: &f64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<i16> for KNumber

source§

fn partial_cmp(&self, b: &i16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<i32> for KNumber

source§

fn partial_cmp(&self, b: &i32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<i64> for KNumber

source§

fn partial_cmp(&self, b: &i64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<i8> for KNumber

source§

fn partial_cmp(&self, b: &i8) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<isize> for KNumber

source§

fn partial_cmp(&self, b: &isize) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<u16> for KNumber

source§

fn partial_cmp(&self, b: &u16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<u32> for KNumber

source§

fn partial_cmp(&self, b: &u32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<u64> for KNumber

source§

fn partial_cmp(&self, b: &u64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<u8> for KNumber

source§

fn partial_cmp(&self, b: &u8) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<usize> for KNumber

source§

fn partial_cmp(&self, b: &usize) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd for KNumber

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Rem for &KNumber

§

type Output = KNumber

The resulting type after applying the % operator.
source§

fn rem(self, other: &KNumber) -> KNumber

Performs the % operation. Read more
source§

impl Rem for KNumber

§

type Output = KNumber

The resulting type after applying the % operator.
source§

fn rem(self, other: KNumber) -> KNumber

Performs the % operation. Read more
source§

impl Sub for &KNumber

§

type Output = KNumber

The resulting type after applying the - operator.
source§

fn sub(self, other: &KNumber) -> KNumber

Performs the - operation. Read more
source§

impl Sub for KNumber

§

type Output = KNumber

The resulting type after applying the - operator.
source§

fn sub(self, other: KNumber) -> KNumber

Performs the - operation. Read more
source§

impl Copy for KNumber

source§

impl Eq for KNumber

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,