Struct ldap3::result::CompareResult
source · pub struct CompareResult(pub LdapResult);
Expand description
Wrapper for the result of a Compare operation.
Compare uniquely has two non-zero return codes to indicate the outcome of a successful
comparison, while other return codes indicate errors, as usual (except 10 for referral).
The equal()
method optimizes for the expected case of ignoring
referrals; non_error()
can be used when that’s not possible.
Tuple Fields§
§0: LdapResult
Implementations§
source§impl CompareResult
impl CompareResult
sourcepub fn equal(self) -> Result<bool>
pub fn equal(self) -> Result<bool>
If the result code is 5 (compareFalse) or 6 (compareTrue), return the corresponding
boolean value wrapped in Ok()
, otherwise wrap the LdapResult
part in an LdapError
.
sourcepub fn non_error(self) -> Result<LdapResult>
pub fn non_error(self) -> Result<LdapResult>
If the result code is 5 (compareFalse), 6 (compareTrue), or 10 (referral), return
the inner LdapResult
, otherwise rewrap LdapResult
in an LdapError
.
Trait Implementations§
source§impl Clone for CompareResult
impl Clone for CompareResult
source§fn clone(&self) -> CompareResult
fn clone(&self) -> CompareResult
Returns a copy 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 RefUnwindSafe for CompareResult
impl Send for CompareResult
impl Sync for CompareResult
impl Unpin for CompareResult
impl UnwindSafe for CompareResult
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