pub struct Integer {
pub negative: bool,
pub digits: String,
}Expand description
A 49G exact integer: sign and decimal digits, any length.
Fields§
§negative: boolNegative (never for zero).
digits: StringDecimal digits, most significant first, no leading zeros; 0 for
zero.
Implementations§
Source§impl Integer
impl Integer
Sourcepub fn from_nibbles(n: &[u8]) -> Result<Integer, DecodeError>
pub fn from_nibbles(n: &[u8]) -> Result<Integer, DecodeError>
Decode the nibbles after the length field: digits from the least
significant up, then the sign nibble (0 or 9). Zero is one 0 nibble.
An error’s offset is the nibble of n where it is not an integer.
Sourcepub fn to_nibbles(&self) -> Vec<u8> ⓘ
pub fn to_nibbles(&self) -> Vec<u8> ⓘ
The nibbles after the length field (see Integer::from_nibbles).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Integer
impl<'de> Deserialize<'de> for Integer
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Integer, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Integer, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Integer
impl StructuralPartialEq for Integer
Auto Trait Implementations§
impl Freeze for Integer
impl RefUnwindSafe for Integer
impl Send for Integer
impl Sync for Integer
impl Unpin for Integer
impl UnsafeUnpin for Integer
impl UnwindSafe for Integer
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