Skip to main content

Attributes

Struct Attributes 

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

An original attribute set with independently retained catalogue storage.

Implementations§

Source§

impl<'a> Attributes<'a>

Source

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

Reads nonempty attributes in their trusted schema placement.

RFC5652 §5.3 requires nonempty Signed/UnsignedAttributes. Signed sets are reread under DER through the same parser, not repaired or re-encoded. Generic attributes preserve unknown instances; per-type cardinality and placement checks are separate (§§11.1–11.4, RFC6211 §2). https://www.rfc-editor.org/rfc/rfc5652#section-5.3

Source

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

Reads original attributes while retaining a uniquely bounded empty set.

An empty outer set violates RFC5652 §5.3 and is exposed by Self::fault. This inspection recovery does not relax signed DER, member syntax or binding requirements. It preserves presence rather than treating an invalid written set as absent.

Source

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

The located nonempty-bound violation, without allocating diagnostics.

Original signed bytes remain available for inspection; this fault must be refused before preparing a cryptographic operation.

Source

pub fn items(&self) -> &[Attribute<'a>]

The original attribute catalogue in encoded order.

Source

pub fn element(&self) -> &Element<'a>

The exact range and placement supplied by the schema.

Source

pub fn all<'s>(&'s self, kind: Oid<'s>, execution: &Memory) -> Matching<'s, 'a> ⓘ

Searches every instance with the current retained-query account.

Lookup errors are yielded once, then iteration stops. Absence is returned only after the whole admitted search, including its terminal step.

Source

pub fn all_in<'s>( &'s self, kind: Oid<'s>, parent: &'s Reader<'_>, ) -> Matching<'s, 'a, Execution<'s>> ⓘ

Searches through the producing reader’s local and aggregate ceilings.

Source

pub fn unique_in<'s>( &'s self, kind: Oid<'s>, parent: &'s Reader<'_>, ) -> Result<Option<&'s Attribute<'a>>>

Requires at most one instance for a specifically singleton attribute type.

Unknown generic types must use Self::all_in instead: RFC5652 §5.3 does not forbid every repeated attribute identifier.

Source

pub fn singleton_inspection_in<'s>( &'s self, kind: Oid<'_>, parent: &Reader<'_>, ) -> Result<SingletonReading<'s, 'a>>

Selects one readable original singleton while reporting copied instances.

Only byte-identical copies share one inspection reading. Conflicts refuse rather than choosing a claim; original signed bytes are never normalized. This does not validate the type’s values or relax strict Self::unique_in / binding. Located registered-type violations are retained by crate::signer::SignerInfo::faults.

The producing session is checked before query work. Scanning and byte comparisons use both its local and aggregate current ceilings. The returned borrowing facts retain no query execution or scratch storage.

Source

pub fn signed_bytes(&self) -> Option<[&'a [u8]; 2]>

Original signed octets with only the implicit identifier replaced by SET.

RFC5652 §5.4 requires the SET OF identifier, preserving original DER length/content. Unsigned sets have no such signed range.

Trait Implementations§

Source§

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

§

impl<'a> !RefUnwindSafe for Attributes<'a>

§

impl<'a> !Send for Attributes<'a>

§

impl<'a> !Sync for Attributes<'a>

§

impl<'a> !UnwindSafe for Attributes<'a>

§

impl<'a> Unpin for Attributes<'a>

§

impl<'a> UnsafeUnpin for Attributes<'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.