[][src]Struct ldap3::result::LdapResult

pub struct LdapResult {
    pub rc: u32,
    pub matched: String,
    pub text: String,
    pub refs: Vec<String>,
    pub ctrls: Vec<Control>,
}

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]

impl Debug for LdapResult[src]

impl Display for LdapResult[src]

impl Error for LdapResult[src]

impl From<LdapResult> for LdapError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.