Skip to main content

AccuracyReading

Struct AccuracyReading 

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

Readable scalar fields and conformance faults, without token acceptance.

Fixed component storage cannot grow with attacker-controlled field count. Diagnostics retain their own capacity charge; callers must consider them before accepting a token/proof. Unknown or out-of-order fields and readable nonminimal INTEGERs remain faults. Numerically equal duplicates retain the first original reading; conflicting numeric values refuse rather than selecting a value. This recovery is an inspection contract, not specified by RFC3161.

Implementations§

Source§

impl<'a> AccuracyReading<'a>

Source

pub fn read(parent: &Reader<'a>, element: &Element<'a>) -> Result<Self>

Reads SEQUENCE with optional seconds and primitive IMPLICIT [0]/[1].

RFC3161 §2.4.2 gives millis/micros the range 1..999 and defaults each absent component to zero. Present empty Accuracy is zero, whereas an omitted entire Accuracy provides no bound. Readable out-of-range values are retained exactly with a fault, never clamped. Resource failures abort. https://www.rfc-editor.org/rfc/rfc3161#section-2.4.2

Source

pub fn component(&self, component: Component) -> Option<ComponentReading<'a>>

Original component, absent only when no such field was written.

Source

pub fn span(&self) -> Span

Original complete Accuracy encoding range.

Source

pub fn faults(&self) -> &[Error]

Original schema/conformance faults; accessing them performs no new scan.

Source

pub fn into_faults(self) -> OwnedVec<Error>

Move diagnostic storage without cloning paths or refunding live capacity.

Source

pub fn deviation(&self) -> Result<Accuracy, DeviationError>

Exact nonnegative deviation, independently of conformance acceptance. Negative/wide components are typed failures, never zero or u64::MAX.

Trait Implementations§

Source§

impl<'a> Debug for AccuracyReading<'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 AccuracyReading<'a>

§

impl<'a> RefUnwindSafe for AccuracyReading<'a>

§

impl<'a> Send for AccuracyReading<'a>

§

impl<'a> Sync for AccuracyReading<'a>

§

impl<'a> Unpin for AccuracyReading<'a>

§

impl<'a> UnsafeUnpin for AccuracyReading<'a>

§

impl<'a> UnwindSafe for AccuracyReading<'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.