Enum atoi::Sign
[−]
[src]
pub enum Sign { Plus, Minus, }
Representation of a numerical sign
Variants
Plus
Minus
Methods
impl Sign
[src]
fn try_from(byte: u8) -> Option<Sign>
Trys to convert an ascii character into a Sign
Example
use atoi::Sign; assert_eq!(Some(Sign::Plus), Sign::try_from(b'+')); assert_eq!(Some(Sign::Minus), Sign::try_from(b'-')); assert_eq!(None, Sign::try_from(b'1'));
fn signum<I>(self) -> I where
I: Signed,
I: Signed,
Returns either +1
or -1
Trait Implementations
impl Clone for Sign
[src]
fn clone(&self) -> Sign
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Sign
[src]
impl Debug for Sign
[src]
impl PartialEq for Sign
[src]
fn eq(&self, __arg_0: &Sign) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.