[−][src]Enum glsp::Num
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.
fn add(self, rhs: Num) -> Num
[src]
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.
fn div(self, rhs: Num) -> Num
[src]
impl FromVal for Num
[src]
fn from_val(val: &Val) -> Result<Num, GError>
[src]
fn from_slot(val: &Slot) -> Result<Num, GError>
[src]
impl Mul<Num> for Num
[src]
type Output = Num
The resulting type after applying the *
operator.
fn mul(self, rhs: Num) -> Num
[src]
impl Neg for Num
[src]
impl PartialEq<Num> for Num
[src]
impl PartialEq<f32> for Num
[src]
impl PartialEq<i32> for Num
[src]
impl PartialOrd<Num> for Num
[src]
fn partial_cmp(&self, other: &Num) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<f32> for Num
[src]
fn partial_cmp(&self, other: &f32) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<i32> for Num
[src]
fn partial_cmp(&self, other: &i32) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Rem<Num> for Num
[src]
type Output = Num
The resulting type after applying the %
operator.
fn rem(self, rhs: Num) -> Num
[src]
impl Sub<Num> for Num
[src]
type Output = Num
The resulting type after applying the -
operator.
fn sub(self, rhs: Num) -> Num
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T> FromElement<Slot> for T where
T: FromVal,
[src]
T: FromVal,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoElement<Slot> for T where
T: ToVal,
[src]
T: ToVal,
impl<T> IntoResult for T where
T: ToVal,
[src]
T: ToVal,
fn into_result(self) -> Result<Slot, GError>
[src]
impl<'a, T> MakeArg<'a> for T where
T: FromVal + MakeTemp<Temp = Slot>,
[src]
T: FromVal + MakeTemp<Temp = Slot>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,