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

pub struct LdapResult {
    pub rc: u32,
    pub matched: String,
    pub text: String,
    pub refs: Vec<HashSet<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

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 component DN, where applicable.

Additional diagnostic text.

Referrals.

In the current implementation, all referrals received during a Search operation will be accumulated in this vector.

Response controls.

Missing and empty controls are both represented by an empty vector.

Methods

impl LdapResult
[src]

If the result code is zero, return the instance itself wrapped in Ok(), otherwise wrap the instance in an io::Error.

If the result code is 0 or 10 (referral), return the instance itself wrapped in Ok(), otherwise wrap the instance in an io::Error.

Trait Implementations

impl Clone for LdapResult
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for LdapResult
[src]

Formats the value using the given formatter.

impl Error for LdapResult
[src]

A short description of the error. Read more

The lower-level cause of this error, if any. Read more

impl Display for LdapResult
[src]

Formats the value using the given formatter. Read more