Struct rcgen::DistinguishedName
source · [−]pub struct DistinguishedName { /* private fields */ }
Expand description
Implementations
sourceimpl DistinguishedName
impl DistinguishedName
sourcepub fn get(&self, ty: &DnType) -> Option<&DnValue>
pub fn get(&self, ty: &DnType) -> Option<&DnValue>
Obtains the attribute value for the given attribute type
sourcepub fn remove(&mut self, ty: DnType) -> bool
pub fn remove(&mut self, ty: DnType) -> bool
Removes the attribute with the specified DnType
Returns true when an actual removal happened, false when no attribute with the specified DnType was found.
sourcepub fn push(&mut self, ty: DnType, s: impl Into<DnValue>)
pub fn push(&mut self, ty: DnType, s: impl Into<DnValue>)
Inserts or updates an attribute that consists of type and name
let mut dn = DistinguishedName::new();
dn.push(DnType::OrganizationName, "Crab widgits SE");
dn.push(DnType::CommonName, DnValue::PrintableString("Master Cert".to_string()));
assert_eq!(dn.get(&DnType::OrganizationName), Some(&DnValue::Utf8String("Crab widgits SE".to_string())));
assert_eq!(dn.get(&DnType::CommonName), Some(&DnValue::PrintableString("Master Cert".to_string())));
sourcepub fn iter(&self) -> DistinguishedNameIterator<'_>ⓘNotable traits for DistinguishedNameIterator<'a>impl<'a> Iterator for DistinguishedNameIterator<'a> type Item = (&'a DnType, &'a DnValue);
pub fn iter(&self) -> DistinguishedNameIterator<'_>ⓘNotable traits for DistinguishedNameIterator<'a>impl<'a> Iterator for DistinguishedNameIterator<'a> type Item = (&'a DnType, &'a DnValue);
Iterate over the entries
Trait Implementations
sourceimpl Clone for DistinguishedName
impl Clone for DistinguishedName
sourcefn clone(&self) -> DistinguishedName
fn clone(&self) -> DistinguishedName
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 Debug for DistinguishedName
impl Debug for DistinguishedName
sourceimpl PartialEq<DistinguishedName> for DistinguishedName
impl PartialEq<DistinguishedName> for DistinguishedName
sourcefn eq(&self, other: &DistinguishedName) -> bool
fn eq(&self, other: &DistinguishedName) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &DistinguishedName) -> bool
fn ne(&self, other: &DistinguishedName) -> bool
This method tests for !=
.
impl Eq for DistinguishedName
impl StructuralEq for DistinguishedName
impl StructuralPartialEq for DistinguishedName
Auto Trait Implementations
impl RefUnwindSafe for DistinguishedName
impl Send for DistinguishedName
impl Sync for DistinguishedName
impl Unpin for DistinguishedName
impl UnwindSafe for DistinguishedName
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more