Struct x509_parser::x509::AttributeTypeAndValue
source · [−]pub struct AttributeTypeAndValue<'a> { /* private fields */ }
Expand description
A generic attribute type and value
These objects are used as RelativeDistinguishedName
components.
Implementations
sourceimpl<'a> AttributeTypeAndValue<'a>
impl<'a> AttributeTypeAndValue<'a>
sourcepub const fn new(attr_type: Oid<'a>, attr_value: Any<'a>) -> Self
pub const fn new(attr_type: Oid<'a>, attr_value: Any<'a>) -> Self
Builds a new AttributeTypeAndValue
sourcepub const fn attr_value(&self) -> &Any<'_>
pub const fn attr_value(&self) -> &Any<'_>
Returns the attribute value, as ANY
sourcepub fn as_str(&'a self) -> Result<&'a str, X509Error>
pub fn as_str(&'a self) -> Result<&'a str, X509Error>
Attempt to get the content as str
.
This can fail if the object does not contain a string type.
Note: the TryFrom
trait is implemented for &str
, so this is
equivalent to attr.try_into()
.
Only NumericString, PrintableString, UTF8String and IA5String
are considered here. Other string types can be read using as_slice
.
Trait Implementations
sourceimpl<'a> Clone for AttributeTypeAndValue<'a>
impl<'a> Clone for AttributeTypeAndValue<'a>
sourcefn clone(&self) -> AttributeTypeAndValue<'a>
fn clone(&self) -> AttributeTypeAndValue<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for AttributeTypeAndValue<'a>
impl<'a> Debug for AttributeTypeAndValue<'a>
sourceimpl<'a, 'b> From<&'a AttributeTypeAndValue<'b>> for &'a [u8]
impl<'a, 'b> From<&'a AttributeTypeAndValue<'b>> for &'a [u8]
sourcefn from(value: &'a AttributeTypeAndValue<'b>) -> Self
fn from(value: &'a AttributeTypeAndValue<'b>) -> Self
Converts to this type from the input type.
sourceimpl<'a> FromDer<'a, X509Error> for AttributeTypeAndValue<'a>
impl<'a> FromDer<'a, X509Error> for AttributeTypeAndValue<'a>
sourcefn from_der(i: &'a [u8]) -> X509Result<'a, Self>
fn from_der(i: &'a [u8]) -> X509Result<'a, Self>
Attempt to parse input bytes into a DER object (enforcing constraints)
sourceimpl<'a> FromIterator<AttributeTypeAndValue<'a>> for RelativeDistinguishedName<'a>
impl<'a> FromIterator<AttributeTypeAndValue<'a>> for RelativeDistinguishedName<'a>
sourcefn from_iter<T: IntoIterator<Item = AttributeTypeAndValue<'a>>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = AttributeTypeAndValue<'a>>>(iter: T) -> Self
Creates a value from an iterator. Read more
sourceimpl<'a> PartialEq<AttributeTypeAndValue<'a>> for AttributeTypeAndValue<'a>
impl<'a> PartialEq<AttributeTypeAndValue<'a>> for AttributeTypeAndValue<'a>
sourcefn eq(&self, other: &AttributeTypeAndValue<'a>) -> bool
fn eq(&self, other: &AttributeTypeAndValue<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &AttributeTypeAndValue<'a>) -> bool
fn ne(&self, other: &AttributeTypeAndValue<'a>) -> bool
This method tests for !=
.
sourceimpl<'a, 'b> TryFrom<&'a AttributeTypeAndValue<'b>> for &'a str
impl<'a, 'b> TryFrom<&'a AttributeTypeAndValue<'b>> for &'a str
impl<'a> StructuralPartialEq for AttributeTypeAndValue<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for AttributeTypeAndValue<'a>
impl<'a> Send for AttributeTypeAndValue<'a>
impl<'a> Sync for AttributeTypeAndValue<'a>
impl<'a> Unpin for AttributeTypeAndValue<'a>
impl<'a> UnwindSafe for AttributeTypeAndValue<'a>
Blanket Implementations
sourceimpl<'a, T, E> AsTaggedExplicit<'a, E> for T where
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for T where
T: 'a,
sourceimpl<'a, T, E> AsTaggedImplicit<'a, E> for T where
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for T where
T: 'a,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more