Enum cluatoi::AtoiErr[][src]

pub enum AtoiErr {
    Overflow,
    ByteUnk(u8),
}

Result trait Atoi

Variants

Overflow of number.

assert_eq!(u8::atoi(b"256"), Result::Err(AtoiErr::Overflow));
assert_eq!(u16::atoi(b"65536"), Result::Err(AtoiErr::Overflow));
assert_eq!(u32::atoi(b"4294967296"), Result::Err(AtoiErr::Overflow));
assert_eq!(u64::atoi(b"18446744073709551616"), Result::Err(AtoiErr::Overflow));

In the byte sequence, an unknown character was used.

assert_eq!(u8::atoi(b"-128"), Result::Err(AtoiErr::ByteUnk(b'-')));
assert_eq!(u16::atoi(b"-128"), Result::Err(AtoiErr::ByteUnk(b'-')));
assert_eq!(u32::atoi(b"-128"), Result::Err(AtoiErr::ByteUnk(b'-')));
assert_eq!(u64::atoi(b"-128"), Result::Err(AtoiErr::ByteUnk(b'-')));

assert_eq!(u8::atoi(b"128U"), Result::Err(AtoiErr::ByteUnk(b'U')));
assert_eq!(u16::atoi(b"128L"), Result::Err(AtoiErr::ByteUnk(b'L')));
assert_eq!(u32::atoi(b"128I"), Result::Err(AtoiErr::ByteUnk(b'I')));
assert_eq!(u64::atoi(b"128N"), Result::Err(AtoiErr::ByteUnk(b'N')));

Trait Implementations

impl Debug for AtoiErr
[src]

Formats the value using the given formatter. Read more

impl PartialEq for AtoiErr
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for AtoiErr
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for AtoiErr

impl Sync for AtoiErr