[][src]Enum glsp::Num

pub enum Num {
    Int(i32),
    Flo(f32),
}

A type-erased num.

In general, you can manipulate a Num in the same way that you would manipulate an i32 or f32. Num supports familiar methods like abs and div_euclid, as well as the built-in numeric operators like + and %.

Variants

Int(i32)
Flo(f32)

Implementations

impl Num[src]

pub fn is_int(self) -> bool[src]

pub fn is_flo(self) -> bool[src]

pub fn unwrap_int(self) -> i32[src]

pub fn unwrap_flo(self) -> f32[src]

pub fn into_f32(self) -> f32[src]

pub fn abs(self) -> Num[src]

pub fn div_euclid(self, other: Num) -> Num[src]

pub fn wrapping_div_euclid(self, other: Num) -> Num[src]

pub fn rem_euclid(self, other: Num) -> Num[src]

pub fn wrapping_rem_euclid(self, other: Num) -> Num[src]

Trait Implementations

impl Add<Num> for Num[src]

type Output = Num

The resulting type after applying the + operator.

impl Clone for Num[src]

impl Copy for Num[src]

impl Debug for Num[src]

impl Default for Num[src]

impl Display for Num[src]

impl Div<Num> for Num[src]

type Output = Num

The resulting type after applying the / operator.

impl FromVal for Num[src]

impl Mul<Num> for Num[src]

type Output = Num

The resulting type after applying the * operator.

impl Neg for Num[src]

type Output = Num

The resulting type after applying the - operator.

impl PartialEq<Num> for Num[src]

impl PartialEq<f32> for Num[src]

impl PartialEq<i32> for Num[src]

impl PartialOrd<Num> for Num[src]

impl PartialOrd<f32> for Num[src]

impl PartialOrd<i32> for Num[src]

impl Rem<Num> for Num[src]

type Output = Num

The resulting type after applying the % operator.

impl Sub<Num> for Num[src]

type Output = Num

The resulting type after applying the - operator.

impl ToVal for Num[src]

Auto Trait Implementations

impl GSend for Num

impl GStore for Num

impl RefUnwindSafe for Num

impl Send for Num

impl Sync for Num

impl Unpin for Num

impl UnwindSafe for Num

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> FromElement<Slot> for T where
    T: FromVal
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoElement<Slot> for T where
    T: ToVal
[src]

impl<T> IntoResult for T where
    T: ToVal
[src]

impl<'a, T> MakeArg<'a> for T where
    T: FromVal + MakeTemp<Temp = Slot>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.