x509_cert::attr

Type Alias Attributes

Source
pub type Attributes = SetOfVec<Attribute>;
Expand description

X.501 Attributes as defined in RFC 2986 Section 4.

Attributes { ATTRIBUTE:IOSet } ::= SET OF Attribute{{ IOSet }}

Aliased Type§

struct Attributes { /* private fields */ }

Implementations

Source§

impl<T> SetOfVec<T>
where T: DerOrd,

Source

pub fn new() -> SetOfVec<T>

Create a new SetOfVec.

Source

pub fn from_iter<I>(iter: I) -> Result<SetOfVec<T>, Error>
where I: IntoIterator<Item = T>,

Create a new SetOfVec from the given iterator.

Note: this is an inherent method instead of an impl of the FromIterator trait in order to be fallible.

Source

pub fn add(&mut self, item: T) -> Result<(), Error>

👎Deprecated since 0.7.6: use insert or insert_ordered instead

Add an element to this SetOfVec.

Items MUST be added in lexicographical order according to the DerOrd impl on T.

Source

pub fn extend<I>(&mut self, iter: I) -> Result<(), Error>
where I: IntoIterator<Item = T>,

Extend a SetOfVec using an iterator.

Note: this is an inherent method instead of an impl of the Extend trait in order to be fallible.

Source

pub fn insert(&mut self, item: T) -> Result<(), Error>

Insert an item into this SetOfVec. Must be unique.

Source

pub fn insert_ordered(&mut self, item: T) -> Result<(), Error>

Insert an item into this SetOfVec. Must be unique.

Items MUST be added in lexicographical order according to the DerOrd impl on T.

Source

pub fn as_slice(&self) -> &[T]

Borrow the elements of this SetOfVec as a slice.

Source

pub fn get(&self, index: usize) -> Option<&T>

Get the nth element from this SetOfVec.

Source

pub fn into_vec(self) -> Vec<T>

Convert this SetOfVec into the inner Vec.

Source

pub fn iter(&self) -> Iter<'_, T>

Iterate over the elements of this SetOfVec.

Source

pub fn is_empty(&self) -> bool

Is this SetOfVec empty?

Source

pub fn len(&self) -> usize

Number of elements in this SetOfVec.

Trait Implementations

Source§

impl<T> AsRef<[T]> for SetOfVec<T>
where T: DerOrd,

Source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> Clone for SetOfVec<T>
where T: Clone + DerOrd,

Source§

fn clone(&self) -> SetOfVec<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for SetOfVec<T>
where T: Debug + DerOrd,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a, T> DecodeValue<'a> for SetOfVec<T>
where T: Decode<'a> + DerOrd,

Source§

fn decode_value<R>(reader: &mut R, header: Header) -> Result<SetOfVec<T>, Error>
where R: Reader<'a>,

Attempt to decode this message using the provided Reader.
Source§

impl<T> Default for SetOfVec<T>
where T: DerOrd,

Source§

fn default() -> SetOfVec<T>

Returns the “default value” for a type. Read more
Source§

impl<'a, T> EncodeValue for SetOfVec<T>
where T: 'a + Decode<'a> + Encode + DerOrd,

Source§

fn value_len(&self) -> Result<Length, Error>

Compute the length of this value (sans [Tag]+Length header) when encoded as ASN.1 DER.
Source§

fn encode_value(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode value (sans [Tag]+Length header) as ASN.1 DER using the provided Writer.
Source§

fn header(&self) -> Result<Header, Error>
where Self: Tagged,

Get the Header used to encode this value.
Source§

impl<T> FixedTag for SetOfVec<T>
where T: DerOrd,

Source§

const TAG: Tag = Tag::Set

ASN.1 tag
Source§

impl<T> Ord for SetOfVec<T>
where T: Ord + DerOrd,

Source§

fn cmp(&self, other: &SetOfVec<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T> PartialEq for SetOfVec<T>
where T: PartialEq + DerOrd,

Source§

fn eq(&self, other: &SetOfVec<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialOrd for SetOfVec<T>
where T: PartialOrd + DerOrd,

Source§

fn partial_cmp(&self, other: &SetOfVec<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T, const N: usize> TryFrom<[T; N]> for SetOfVec<T>
where T: DerOrd,

Source§

type Error = Error

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

fn try_from(arr: [T; N]) -> Result<SetOfVec<T>, Error>

Performs the conversion.
Source§

impl<T> TryFrom<Vec<T>> for SetOfVec<T>
where T: DerOrd,

Source§

type Error = Error

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

fn try_from(vec: Vec<T>) -> Result<SetOfVec<T>, Error>

Performs the conversion.
Source§

impl<T> ValueOrd for SetOfVec<T>
where T: DerOrd,

Source§

fn value_cmp(&self, other: &SetOfVec<T>) -> Result<Ordering, Error>

Return an Ordering between value portion of TLV-encoded self and other when serialized as ASN.1 DER.
Source§

impl<T> Eq for SetOfVec<T>
where T: Eq + DerOrd,

Source§

impl<T> StructuralPartialEq for SetOfVec<T>
where T: DerOrd,