Struct rocket::mtls::x509::AttributeTypeAndValue
[−]pub struct AttributeTypeAndValue<'a> { /* private fields */ }
mtls
only.Expand description
A generic attribute type and value
These objects are used as RelativeDistinguishedName
components.
Implementations
impl<'a> AttributeTypeAndValue<'a>
impl<'a> AttributeTypeAndValue<'a>
pub const fn new(
attr_type: Oid<'a>,
attr_value: BerObject<'a>
) -> AttributeTypeAndValue<'a>
pub const fn new(
attr_type: Oid<'a>,
attr_value: BerObject<'a>
) -> AttributeTypeAndValue<'a>
Builds a new AttributeTypeAndValue
pub const fn attr_value(&self) -> &BerObject<'_>
pub const fn attr_value(&self) -> &BerObject<'_>
Returns the attribute value, as raw DerObject
pub 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
impl<'a> Clone for AttributeTypeAndValue<'a>
impl<'a> Clone for AttributeTypeAndValue<'a>
fn 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
impl<'a> Debug for AttributeTypeAndValue<'a>
impl<'a> Debug for AttributeTypeAndValue<'a>
impl<'a> FromDer<'a> for AttributeTypeAndValue<'a>
impl<'a> FromDer<'a> for AttributeTypeAndValue<'a>
impl<'a> FromIterator<AttributeTypeAndValue<'a>> for RelativeDistinguishedName<'a>
impl<'a> FromIterator<AttributeTypeAndValue<'a>> for RelativeDistinguishedName<'a>
fn from_iter<T>(iter: T) -> RelativeDistinguishedName<'a> where
T: IntoIterator<Item = AttributeTypeAndValue<'a>>,
fn from_iter<T>(iter: T) -> RelativeDistinguishedName<'a> where
T: IntoIterator<Item = AttributeTypeAndValue<'a>>,
Creates a value from an iterator. Read more
impl<'a> PartialEq<AttributeTypeAndValue<'a>> for AttributeTypeAndValue<'a>
impl<'a> PartialEq<AttributeTypeAndValue<'a>> for AttributeTypeAndValue<'a>
fn 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
fn ne(&self, other: &AttributeTypeAndValue<'a>) -> bool
fn ne(&self, other: &AttributeTypeAndValue<'a>) -> bool
This method tests for !=
.
impl<'a> TryFrom<AttributeTypeAndValue<'a>> for &'a [u8]
impl<'a> TryFrom<AttributeTypeAndValue<'a>> for &'a [u8]
impl<'a> TryFrom<AttributeTypeAndValue<'a>> for &'a str
impl<'a> TryFrom<AttributeTypeAndValue<'a>> for &'a str
fn try_from(
value: AttributeTypeAndValue<'a>
) -> Result<&'a str, <&'a str as TryFrom<AttributeTypeAndValue<'a>>>::Error>
fn try_from(
value: AttributeTypeAndValue<'a>
) -> Result<&'a str, <&'a str as TryFrom<AttributeTypeAndValue<'a>>>::Error>
Performs the conversion.
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
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self>
impl<'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> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
sourcefn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>,
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
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more