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 moresourceimpl 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
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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