[−][src]Enum arithmetic_sign::Sign
Negative or Positive for sign marking and sign part calculations
note: Need use std::convert::TryFrom
if you want to use TryFrom<f32>
or TryFrom<f64>
Variants
Negative, is a negative [-inf..0)
Positive, is not a negative [0..+inf]
Implementations
impl Sign
[src]
pub fn to_string_specific<'a>(
&self,
if_negative: &'a str,
if_positive: &'a str
) -> &'a str
[src]
&self,
if_negative: &'a str,
if_positive: &'a str
) -> &'a str
pub fn is_positive(&self) -> bool
[src]
pub fn is_negative(&self) -> bool
[src]
pub fn as_f32(&self) -> f32
[src]
pub fn as_f64(&self) -> f64
[src]
pub fn as_i8(&self) -> i8
[src]
pub fn as_i16(&self) -> i16
[src]
pub fn as_i32(&self) -> i32
[src]
pub fn as_i64(&self) -> i64
[src]
pub fn as_i128(&self) -> i128
[src]
pub fn as_u8(&self) -> Result<u8, ArithmeticSignError>
[src]
pub fn as_u16(&self) -> Result<u16, ArithmeticSignError>
[src]
pub fn as_u32(&self) -> Result<u32, ArithmeticSignError>
[src]
pub fn as_u64(&self) -> Result<u64, ArithmeticSignError>
[src]
pub fn as_u128(&self) -> Result<u128, ArithmeticSignError>
[src]
Trait Implementations
impl Clone for Sign
[src]
impl Copy for Sign
[src]
impl Debug for Sign
[src]
impl Display for Sign
[src]
impl Div<Sign> for Sign
[src]
type Output = Sign
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self::Output
[src]
impl Eq for Sign
[src]
impl From<i128> for Sign
[src]
impl From<i16> for Sign
[src]
impl From<i32> for Sign
[src]
impl From<i64> for Sign
[src]
impl From<i8> for Sign
[src]
impl From<u128> for Sign
[src]
impl From<u16> for Sign
[src]
impl From<u32> for Sign
[src]
impl From<u64> for Sign
[src]
impl From<u8> for Sign
[src]
impl Mul<Sign> for Sign
[src]
type Output = Sign
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self::Output
[src]
impl Neg for Sign
[src]
type Output = Sign
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl Not for Sign
[src]
type Output = Sign
The resulting type after applying the !
operator.
fn not(self) -> Self::Output
[src]
impl Ord for Sign
[src]
fn cmp(&self, other: &Sign) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Sign> for Sign
[src]
impl PartialOrd<Sign> for Sign
[src]
fn partial_cmp(&self, other: &Sign) -> 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 StructuralEq for Sign
[src]
impl StructuralPartialEq for Sign
[src]
impl TryFrom<f32> for Sign
[src]
type Error = ArithmeticSignError
The type returned in the event of a conversion error.
fn try_from(v: f32) -> Result<Self, Self::Error>
[src]
impl TryFrom<f64> for Sign
[src]
Auto Trait Implementations
impl RefUnwindSafe for Sign
impl Send for Sign
impl Sync for Sign
impl Unpin for Sign
impl UnwindSafe for Sign
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> 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.
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>,