pub enum DataNumber {
U8(u8),
U16(u16),
U24(u32),
I24(i32),
U32(u32),
U64(u64),
U128(u128),
I32(i32),
}
Expand description
Holds our datatypes and values post parsing
Variants§
Implementations§
source§impl DataNumber
impl DataNumber
Convert into usize, mainly for serialization purposes
sourcepub fn parse(
i: &[u8],
field_length: u16,
signed: bool,
) -> IResult<&[u8], DataNumber>
pub fn parse( i: &[u8], field_length: u16, signed: bool, ) -> IResult<&[u8], DataNumber>
Parse bytes into DataNumber Type
pub fn from_field_type( remaining: &[u8], field_type: FieldDataType, field_length: u16, ) -> IResult<&[u8], FieldValue>
Trait Implementations§
source§impl Clone for DataNumber
impl Clone for DataNumber
source§fn clone(&self) -> DataNumber
fn clone(&self) -> DataNumber
Returns a copy 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 DataNumber
impl Debug for DataNumber
source§impl From<DataNumber> for usize
impl From<DataNumber> for usize
Convert into usize, mainly for serialization purposes
source§fn from(val: DataNumber) -> Self
fn from(val: DataNumber) -> Self
Converts to this type from the input type.
source§impl Ord for DataNumber
impl Ord for DataNumber
source§fn cmp(&self, other: &DataNumber) -> Ordering
fn cmp(&self, other: &DataNumber) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for DataNumber
impl PartialEq for DataNumber
source§impl PartialOrd for DataNumber
impl PartialOrd for DataNumber
source§impl Serialize for DataNumber
impl Serialize for DataNumber
source§impl TryFrom<&DataNumber> for i32
impl TryFrom<&DataNumber> for i32
source§type Error = DataNumberError
type Error = DataNumberError
The type returned in the event of a conversion error.
source§impl TryFrom<&DataNumber> for u128
impl TryFrom<&DataNumber> for u128
source§type Error = DataNumberError
type Error = DataNumberError
The type returned in the event of a conversion error.
source§impl TryFrom<&DataNumber> for u16
impl TryFrom<&DataNumber> for u16
source§type Error = DataNumberError
type Error = DataNumberError
The type returned in the event of a conversion error.
source§impl TryFrom<&DataNumber> for u32
impl TryFrom<&DataNumber> for u32
source§type Error = DataNumberError
type Error = DataNumberError
The type returned in the event of a conversion error.
source§impl TryFrom<&DataNumber> for u64
impl TryFrom<&DataNumber> for u64
source§type Error = DataNumberError
type Error = DataNumberError
The type returned in the event of a conversion error.
source§impl TryFrom<&DataNumber> for u8
impl TryFrom<&DataNumber> for u8
source§type Error = DataNumberError
type Error = DataNumberError
The type returned in the event of a conversion error.
impl Eq for DataNumber
impl StructuralPartialEq for DataNumber
Auto Trait Implementations§
impl Freeze for DataNumber
impl RefUnwindSafe for DataNumber
impl Send for DataNumber
impl Sync for DataNumber
impl Unpin for DataNumber
impl UnwindSafe for DataNumber
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)