[−][src]Struct ldap3::result::LdapResult
Common components of an LDAP operation result.
This structure faithfully replicates the components dictated by the standard,
and is distinctly C-like with its reliance on numeric codes for the indication
of outcome. It would be tempting to hide it behind an automatic Result
-like
interface, but there are scenarios where this would preclude intentional
incorporation of error conditions into query design. Instead, the struct
implements helper methods, success()
and
non_error()
, which may be used for ergonomic error
handling when simple condition checking suffices.
Fields
rc: u32
Result code.
Generally, the value of zero indicates successful completion, but there's a number of other non-error codes arising as a result of various operations. See Section A.1 of RFC 4511.
matched: String
Matched component DN, where applicable.
text: String
Additional diagnostic text.
refs: Vec<String>
Referrals.
Absence of referrals is represented by an empty vector.
ctrls: Vec<Control>
Response controls.
Missing and empty controls are both represented by an empty vector.
Implementations
impl LdapResult
[src]
pub fn success(self) -> Result<Self>
[src]
If the result code is zero, return the instance itself wrapped
in Ok()
, otherwise wrap the instance in an LdapError
.
pub fn non_error(self) -> Result<Self>
[src]
If the result code is 0 or 10 (referral), return the instance
itself wrapped in Ok()
, otherwise wrap the instance in an
LdapError
.
Trait Implementations
impl Clone for LdapResult
[src]
fn clone(&self) -> LdapResult
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for LdapResult
[src]
impl Display for LdapResult
[src]
impl Error for LdapResult
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<LdapResult> for LdapError
[src]
fn from(source: LdapResult) -> Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for LdapResult
impl Send for LdapResult
impl Sync for LdapResult
impl Unpin for LdapResult
impl UnwindSafe for LdapResult
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,