pub enum Sign {
Negative = -1,
Positive = 1,
}Expand description
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§
Implementations§
Source§impl Sign
impl Sign
pub fn to_string_specific<'a>( &self, if_negative: &'a str, if_positive: &'a str, ) -> &'a str
pub fn is_positive(&self) -> bool
pub fn is_negative(&self) -> bool
pub fn as_f32(&self) -> f32
pub fn as_f64(&self) -> f64
pub fn as_i8(&self) -> i8
pub fn as_i16(&self) -> i16
pub fn as_i32(&self) -> i32
pub fn as_i64(&self) -> i64
pub fn as_i128(&self) -> i128
pub fn as_u8(&self) -> Result<u8, ArithmeticSignError>
pub fn as_u16(&self) -> Result<u16, ArithmeticSignError>
pub fn as_u32(&self) -> Result<u32, ArithmeticSignError>
pub fn as_u64(&self) -> Result<u64, ArithmeticSignError>
pub fn as_u128(&self) -> Result<u128, ArithmeticSignError>
Trait Implementations§
Source§impl Ord for Sign
impl Ord for Sign
Source§impl PartialOrd for Sign
impl PartialOrd for Sign
impl Copy for Sign
impl Eq for Sign
impl StructuralPartialEq for Sign
Auto Trait Implementations§
impl Freeze for Sign
impl RefUnwindSafe for Sign
impl Send for Sign
impl Sync for Sign
impl Unpin for Sign
impl UnwindSafe for Sign
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more