Struct der::BigUInt [−][src]
big-uint
only.“Big” unsigned ASN.1 INTEGER
type.
Provides direct access to the underlying big endian bytes which comprise an unsigned integer value.
Intended for use cases like very large integers that are used in cryptographic applications (e.g. keys, signatures).
Generic over a Size
value (e.g. der::consts::U64
),
indicating the size of an integer in bytes.
Currently supported sizes are 1 - 512 bytes.
Implementations
impl<'a, N> BigUInt<'a, N> where
N: Unsigned + NonZero,
[src]
N: Unsigned + NonZero,
pub fn new(bytes: &'a [u8]) -> Result<Self>
[src]
Create a new BigUInt
from a byte slice.
Slice may be less than or equal to N
bytes.
pub fn as_bytes(&self) -> &'a [u8]
[src]
Borrow the inner byte slice which contains the least significant bytes
of a big endian integer value with all leading zeros stripped, and may
be any length from empty (i.e. zero) to N
bytes.
pub fn len(&self) -> Length
[src]
Get the length of this BigUInt
in bytes.
pub fn is_empty(&self) -> bool
[src]
Is the inner byte slice empty?
Trait Implementations
impl<'a, N: Clone + Unsigned + NonZero> Clone for BigUInt<'a, N>
[src]
impl<'a, N: Copy + Unsigned + NonZero> Copy for BigUInt<'a, N>
[src]
impl<'a, N: Debug + Unsigned + NonZero> Debug for BigUInt<'a, N>
[src]
impl<'a, N> Encodable for BigUInt<'a, N> where
N: Unsigned + NonZero,
[src]
N: Unsigned + NonZero,
fn encoded_len(&self) -> Result<Length>
[src]
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>
[src]
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
[src]
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length>
[src]
fn to_vec(&self) -> Result<Vec<u8>>
[src]
impl<'a, N: Eq + Unsigned + NonZero> Eq for BigUInt<'a, N>
[src]
impl<'a, N> From<&'_ BigUInt<'a, N>> for BigUInt<'a, N> where
N: Unsigned + NonZero,
[src]
N: Unsigned + NonZero,
impl<'a, N: PartialEq + Unsigned + NonZero> PartialEq<BigUInt<'a, N>> for BigUInt<'a, N>
[src]
impl<'a, N: PartialOrd + Unsigned + NonZero> PartialOrd<BigUInt<'a, N>> for BigUInt<'a, N>
[src]
fn partial_cmp(&self, other: &BigUInt<'a, N>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, N: Unsigned + NonZero> StructuralEq for BigUInt<'a, N>
[src]
impl<'a, N: Unsigned + NonZero> StructuralPartialEq for BigUInt<'a, N>
[src]
impl<'a, N> Tagged for BigUInt<'a, N> where
N: Unsigned + NonZero,
[src]
N: Unsigned + NonZero,
impl<'a, N> TryFrom<Any<'a>> for BigUInt<'a, N> where
N: Unsigned + NonZero,
[src]
N: Unsigned + NonZero,
Auto Trait Implementations
impl<'a, N> RefUnwindSafe for BigUInt<'a, N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<'a, N> Send for BigUInt<'a, N> where
N: Send,
N: Send,
impl<'a, N> Sync for BigUInt<'a, N> where
N: Sync,
N: Sync,
impl<'a, N> Unpin for BigUInt<'a, N> where
N: Unpin,
N: Unpin,
impl<'a, N> UnwindSafe for BigUInt<'a, N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,