Enum atoi::Sign
[−]
[src]
pub enum Sign { Plus, Minus, }
Representation of a numerical sign
Variants
Plus
Minus
Methods
impl Sign
[src]
pub fn try_from(byte: u8) -> Option<Sign>
[src]
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'));
pub fn signum<I>(self) -> I where
I: Signed,
[src]
I: Signed,
Returns either +1
or -1
Trait Implementations
impl Clone for Sign
[src]
fn clone(&self) -> Sign
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Sign
[src]
impl Debug for Sign
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for Sign
[src]
fn eq(&self, __arg_0: &Sign) -> bool
[src]
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[src]
This method tests for !=
.