Skip to main content

IntegerReading

Struct IntegerReading 

Source
pub struct IntegerReading<'a> { /* private fields */ }
Expand description

An INTEGER’s original contents, numeric view and encoding diagnostic.

The original bytes are never rewritten. value() borrows a minimal suffix of those bytes so its numeric conversions inspect at most eight significant octets. A nonminimal source is still malformed BER/DER (X.690 §8.3.2). Only the diagnostic path owns storage, retaining its account until drop.

Implementations§

Source§

impl<'a> IntegerReading<'a>

Source

pub fn as_bytes(&self) -> &'a [u8] ⓘ

Original two’s-complement contents, including redundant sign octets.

Source

pub fn value(&self) -> Integer<'a>

Borrowed minimal numeric view; obtaining it performs no padding scan.

Source

pub fn fault(&self) -> Option<&Error>

Original located minimality violation; None means minimal contents.

Source

pub fn into_parts(self) -> (Integer<'a>, Option<Error>)

Move the numeric view and diagnostic without copying their storage.

Retain as_bytes() or the original element separately when wire identity is needed. The minimal view is not a replacement signed value.

Trait Implementations§

Source§

impl<'a> Debug for IntegerReading<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for IntegerReading<'a>

§

impl<'a> RefUnwindSafe for IntegerReading<'a>

§

impl<'a> Send for IntegerReading<'a>

§

impl<'a> Sync for IntegerReading<'a>

§

impl<'a> Unpin for IntegerReading<'a>

§

impl<'a> UnsafeUnpin for IntegerReading<'a>

§

impl<'a> UnwindSafe for IntegerReading<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.