pub struct SearchEntry {
pub dn: String,
pub attrs: HashMap<String, Vec<String>>,
pub bin_attrs: HashMap<String, Vec<Vec<u8>>>,
}
Expand description
Parsed search result entry.
While LDAP attributes can have a variety of syntaxes, they’re all returned in search results as octet strings, without any associated type information. A general-purpose result parser could leave all values in that format, but then retrieving them from user code would be cumbersome and tedious.
For that reason, the parser tries to convert every value into a String
. If an
attribute can contain unconstrained binary strings, the conversion may fail. In that case,
the attribute and all its values will be in the bin_attrs
hashmap. Since it’s
possible that a particular set of values for a binary attribute could be
converted into UTF-8 String
s, the presence of such an attribute in the result
entry should be checked for both in attrs
and bin_atrrs
.
Fields§
§dn: String
Entry DN.
attrs: HashMap<String, Vec<String>>
Attributes.
bin_attrs: HashMap<String, Vec<Vec<u8>>>
Binary-valued attributes.
Implementations§
Source§impl SearchEntry
impl SearchEntry
Sourcepub fn construct(re: ResultEntry) -> SearchEntry
pub fn construct(re: ResultEntry) -> SearchEntry
Parse raw BER data and convert it into attribute map(s).
Note: this function will panic on parsing error.
Trait Implementations§
Source§impl Clone for SearchEntry
impl Clone for SearchEntry
Source§fn clone(&self) -> SearchEntry
fn clone(&self) -> SearchEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for SearchEntry
impl RefUnwindSafe for SearchEntry
impl Send for SearchEntry
impl Sync for SearchEntry
impl Unpin for SearchEntry
impl UnwindSafe for SearchEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more