Struct ldap3::SearchEntry
[−]
[src]
pub struct SearchEntry { pub dn: String, pub attrs: HashMap<String, Vec<String>>, pub bin_attrs: HashMap<String, Vec<Vec<u8>>>, }
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 of such attribute in the result
entry should be checked for both in attrs
and bin_atrrs
.
In the future versions of the library, this parsing interface will be de-emphasized in favor of custom Serde deserialization of search results directly into a user-supplied struct, which is expected to be a better fit for the majority of uses.
Fields
dn: String
Entry DN.
attrs: HashMap<String, Vec<String>>
Attributes.
bin_attrs: HashMap<String, Vec<Vec<u8>>>
Binary-valued attributes.
Methods
impl SearchEntry
[src]
fn construct(re: ResultEntry) -> SearchEntry
Parse raw BER data and convert it into attribute map(s).
Note: this function will panic on parsing error. Error handling will be improved in a future version of the library.
Trait Implementations
impl Debug for SearchEntry
[src]
impl Clone for SearchEntry
[src]
fn clone(&self) -> SearchEntry
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more