pub struct LdapDnEncoder;Expand description
Encodes strings for safe use in LDAP Distinguished Name components (RFC 4514).
Escapes the special characters ,, +, ", \, <, >, ;, and =.
Leading # and leading/trailing spaces are also escaped. Null bytes are
hex-escaped as \00.
Returns Cow::Borrowed when the input needs no encoding (zero-allocation
fast path).
§Examples
use secure_output::ldap::LdapDnEncoder;
use secure_output::encode::OutputEncoder;
let encoder = LdapDnEncoder;
assert_eq!(encoder.encode("John Smith"), "John Smith");
assert_eq!(encoder.encode("a+b,c=d"), "a\\+b\\,c\\=d");Trait Implementations§
Source§impl Clone for LdapDnEncoder
impl Clone for LdapDnEncoder
Source§fn clone(&self) -> LdapDnEncoder
fn clone(&self) -> LdapDnEncoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LdapDnEncoder
impl Debug for LdapDnEncoder
Source§impl Default for LdapDnEncoder
impl Default for LdapDnEncoder
Source§fn default() -> LdapDnEncoder
fn default() -> LdapDnEncoder
Returns the “default value” for a type. Read more
Source§impl OutputEncoder for LdapDnEncoder
impl OutputEncoder for LdapDnEncoder
impl Copy for LdapDnEncoder
Auto Trait Implementations§
impl Freeze for LdapDnEncoder
impl RefUnwindSafe for LdapDnEncoder
impl Send for LdapDnEncoder
impl Sync for LdapDnEncoder
impl Unpin for LdapDnEncoder
impl UnsafeUnpin for LdapDnEncoder
impl UnwindSafe for LdapDnEncoder
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