pub struct CIntegerLiteralCodec;Expand description
Decodes non-negative C integer literal fragments.
This codec accepts decimal literals such as 123, octal literals such as
0123, and hexadecimal literals such as 0x123 or 0X123. It trims
surrounding whitespace and returns a u64.
Implementations§
Source§impl CIntegerLiteralCodec
impl CIntegerLiteralCodec
Sourcepub fn decode(&self, text: &str) -> CodecResult<u64>
pub fn decode(&self, text: &str) -> CodecResult<u64>
Decodes a C integer literal into a u64.
§Parameters
text: C integer literal text.
§Returns
Parsed integer value.
§Errors
Returns CodecError::InvalidInput when the input is empty, lacks digits,
or overflows u64; returns CodecError::InvalidDigit when a character
is not valid for the detected radix.
Trait Implementations§
Source§impl Clone for CIntegerLiteralCodec
impl Clone for CIntegerLiteralCodec
Source§fn clone(&self) -> CIntegerLiteralCodec
fn clone(&self) -> CIntegerLiteralCodec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CIntegerLiteralCodec
impl Debug for CIntegerLiteralCodec
Source§impl Decoder<str> for CIntegerLiteralCodec
impl Decoder<str> for CIntegerLiteralCodec
Source§impl Default for CIntegerLiteralCodec
impl Default for CIntegerLiteralCodec
Source§fn default() -> CIntegerLiteralCodec
fn default() -> CIntegerLiteralCodec
Returns the “default value” for a type. Read more
Source§impl PartialEq for CIntegerLiteralCodec
impl PartialEq for CIntegerLiteralCodec
impl Copy for CIntegerLiteralCodec
impl Eq for CIntegerLiteralCodec
impl StructuralPartialEq for CIntegerLiteralCodec
Auto Trait Implementations§
impl Freeze for CIntegerLiteralCodec
impl RefUnwindSafe for CIntegerLiteralCodec
impl Send for CIntegerLiteralCodec
impl Sync for CIntegerLiteralCodec
impl Unpin for CIntegerLiteralCodec
impl UnsafeUnpin for CIntegerLiteralCodec
impl UnwindSafe for CIntegerLiteralCodec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more