[−][src]Enum glsp_engine::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.
pub 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.
pub fn div(self, rhs: Num) -> Num
[src]
impl Eq for Num
[src]
impl FromVal for Num
[src]
impl IntoVal for Num
[src]
impl Mul<Num> for Num
[src]
type Output = Num
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Num) -> Num
[src]
impl Neg for Num
[src]
impl Ord for Num
[src]
pub fn cmp(&self, other: &Num) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Num> for Num
[src]
pub fn eq(&self, other: &Num) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Num> for i32
[src]
pub fn eq(&self, other: &Num) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Num> for f32
[src]
pub fn eq(&self, other: &Num) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<f32> for Num
[src]
pub fn eq(&self, other: &f32) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<i32> for Num
[src]
pub fn eq(&self, other: &i32) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Num> for Num
[src]
pub fn partial_cmp(&self, other: &Num) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Num> for i32
[src]
pub fn partial_cmp(&self, other: &Num) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Num> for f32
[src]
pub fn partial_cmp(&self, other: &Num) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<f32> for Num
[src]
pub fn partial_cmp(&self, other: &f32) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<i32> for Num
[src]
pub fn partial_cmp(&self, other: &i32) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub 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.
pub fn rem(self, rhs: Num) -> Num
[src]
impl Sub<Num> for Num
[src]
Auto Trait Implementations
impl RefUnwindSafe for Num
[src]
impl Send for Num
[src]
impl Sync for Num
[src]
impl Unpin for Num
[src]
impl UnwindSafe for Num
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,