[−][src]Function rustils::parse::ulong::str_to_u64_res
pub fn str_to_u64_res(a: &str) -> ParseResultU64
Arguments
a
- Any&str
Examples
use rustils::parse::ulong::str_to_u64_res; use rustils::error::ParseError::InvalidNumber; assert_eq!(str_to_u64_res("0"), Ok(0_u64)); assert_eq!(str_to_u64_res("18446744073709551615"), Ok(18446744073709551615_u64)); assert_eq!(str_to_u64_res("-1"), Err(InvalidNumber(String::from("-1")))); assert_eq!( str_to_u64_res("18446744073709551616"), Err(InvalidNumber(String::from("18446744073709551616"))) );