pub struct Selector { /* private fields */ }Expand description
An independently owned RFC 4514 distinguished-name assertion.
Parsing is strict: separator whitespace is not implicitly discarded. Values retain their decoded assertion octets or complete original BER. RDN order and unordered membership use the certificate Name’s shared comparison core. Storage remains charged after the parser/account handle is dropped; each subsequent operation takes its own execution account.
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn parse(text: &str, execution: &Memory) -> Result<Self>
pub fn parse(text: &str, execution: &Memory) -> Result<Self>
Parses the grammar of RFC 4514 §3 without compatibility trimming. Unknown numeric types are preserved. An unknown descriptor, malformed escape, incomplete BER value or syntax violation is a located error; unavailable equality semantics remain distinct at comparison time.
use std::sync::Arc;
use structured_asn1::memory::{Memory, MemoryAccount};
use structured_pkix::name::Selector;
let memory = Memory::new(Arc::new(MemoryAccount::new(4096, 100_000)));
let left = Selector::parse("CN=A\\,B,O=Example", &memory)?;
let right = Selector::parse("cn=A\\2CB,o=example", &memory)?;
assert!(left.matches(&right, &memory)?);Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin for Selector
impl UnwindSafe for Selector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more