#[non_exhaustive]pub enum DeterministicCborInteger {
Unsigned(u64),
Negative(DeterministicCborNegativeInteger),
}Expand description
Integer domain supported by the deterministic generic-CBOR profile.
The enum deliberately distinguishes unsigned and negative values so the
full u64 range is preserved without admitting two representations for
nonnegative integers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unsigned(u64)
Unsigned integer in the inclusive range 0..=u64::MAX.
Negative(DeterministicCborNegativeInteger)
Negative integer in the inclusive range i64::MIN..=-1.
Implementations§
Source§impl DeterministicCborInteger
impl DeterministicCborInteger
Sourcepub const fn unsigned(value: u64) -> DeterministicCborInteger
pub const fn unsigned(value: u64) -> DeterministicCborInteger
Construct an unsigned deterministic-CBOR integer.
Sourcepub const fn negative(
value: i64,
) -> Result<DeterministicCborInteger, DeterministicCborProfileError>
pub const fn negative( value: i64, ) -> Result<DeterministicCborInteger, DeterministicCborProfileError>
Construct a negative deterministic-CBOR integer.
Zero and positive values are rejected so callers cannot create a second
semantic spelling for a value that belongs in Self::Unsigned.
Trait Implementations§
Source§impl Debug for DeterministicCborInteger
impl Debug for DeterministicCborInteger
Source§impl Drop for DeterministicCborInteger
impl Drop for DeterministicCborInteger
impl ZeroizeOnDrop for DeterministicCborInteger
Auto Trait Implementations§
impl Freeze for DeterministicCborInteger
impl RefUnwindSafe for DeterministicCborInteger
impl Send for DeterministicCborInteger
impl Sync for DeterministicCborInteger
impl Unpin for DeterministicCborInteger
impl UnsafeUnpin for DeterministicCborInteger
impl UnwindSafe for DeterministicCborInteger
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