pub struct CborInteger(/* private fields */);Available on crate feature
alloc only.Expand description
An integer value permitted by SACP-CBOR/1.
Implementations§
Source§impl CborInteger
impl CborInteger
Sourcepub fn safe(value: i64) -> Result<Self, CborError>
pub fn safe(value: i64) -> Result<Self, CborError>
Construct a safe-range integer.
§Errors
Returns IntegerOutsideSafeRange if the value is outside the safe range.
Sourcepub fn big(negative: bool, magnitude: Vec<u8>) -> Result<Self, CborError>
pub fn big(negative: bool, magnitude: Vec<u8>) -> Result<Self, CborError>
Construct a bignum integer from sign and magnitude bytes.
§Errors
Returns an error if the magnitude is not canonical or is within the safe integer range.
Sourcepub const fn from_bigint(big: BigInt) -> Self
pub const fn from_bigint(big: BigInt) -> Self
Construct a bignum integer from an existing BigInt.
Trait Implementations§
Source§impl<'de> CborDecode<'de> for CborInteger
impl<'de> CborDecode<'de> for CborInteger
Source§impl CborEncode for CborInteger
impl CborEncode for CborInteger
Source§impl Clone for CborInteger
impl Clone for CborInteger
Source§fn clone(&self) -> CborInteger
fn clone(&self) -> CborInteger
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 CborInteger
impl Debug for CborInteger
Source§impl From<BigInt> for CborInteger
impl From<BigInt> for CborInteger
Source§impl PartialEq for CborInteger
impl PartialEq for CborInteger
impl CborArrayElem for CborInteger
impl Eq for CborInteger
impl StructuralPartialEq for CborInteger
Auto Trait Implementations§
impl Freeze for CborInteger
impl RefUnwindSafe for CborInteger
impl Send for CborInteger
impl Sync for CborInteger
impl Unpin for CborInteger
impl UnsafeUnpin for CborInteger
impl UnwindSafe for CborInteger
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