pub enum AtoiErr {
Overflow,
ByteUnk(u8),
}
Expand description
Result trait Atoi
Variants
Overflow
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));
ByteUnk(u8)
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 StructuralPartialEq for AtoiErr
Auto Trait Implementations
impl RefUnwindSafe for AtoiErr
impl Send for AtoiErr
impl Sync for AtoiErr
impl Unpin for AtoiErr
impl UnwindSafe for AtoiErr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more