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: DerObject<'a>) -> Self
pub const fn new(attr_type: Oid<'a>, attr_value: DerObject<'a>) -> Self
Builds a new AttributeTypeAndValue
sourcepub const fn attr_value(&self) -> &DerObject<'_>
pub const fn attr_value(&self) -> &DerObject<'_>
Returns the attribute value, as raw DerObject
sourcepub fn as_str(&self) -> Result<&'a str, X509Error>
pub fn as_str(&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> FromDer<'a> for AttributeTypeAndValue<'a>
impl<'a> FromDer<'a> for AttributeTypeAndValue<'a>
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> TryFrom<AttributeTypeAndValue<'a>> for &'a str
impl<'a> TryFrom<AttributeTypeAndValue<'a>> 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> AsTaggedExplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
sourceimpl<'a, T> AsTaggedImplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> 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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more