pub struct SearchResult(pub Vec<ResultEntry>, pub LdapResult);
Expand description
Wrapper for results of a Search operation which returns all entries at once.
The wrapper exists so that methods success()
and
non_error()
can be called on an instance. Those methods
destructure the wrapper and return its components as elements of an anonymous
tuple.
Tuple Fields§
§0: Vec<ResultEntry>
§1: LdapResult
Implementations§
Source§impl SearchResult
impl SearchResult
Sourcepub fn success(self) -> Result<(Vec<ResultEntry>, LdapResult)>
pub fn success(self) -> Result<(Vec<ResultEntry>, LdapResult)>
If the result code is zero, return an anonymous tuple of component structs
wrapped in Ok()
, otherwise wrap the LdapResult
part in an LdapError
.
Sourcepub fn non_error(self) -> Result<(Vec<ResultEntry>, LdapResult)>
pub fn non_error(self) -> Result<(Vec<ResultEntry>, LdapResult)>
If the result code is 0 or 10 (referral), return an anonymous tuple of component
structs wrapped in Ok()
, otherwise wrap the LdapResult
part in an LdapError
.
Trait Implementations§
Source§impl Clone for SearchResult
impl Clone for SearchResult
Source§fn clone(&self) -> SearchResult
fn clone(&self) -> SearchResult
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 moreAuto Trait Implementations§
impl Freeze for SearchResult
impl RefUnwindSafe for SearchResult
impl Send for SearchResult
impl Sync for SearchResult
impl Unpin for SearchResult
impl UnwindSafe for SearchResult
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