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
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<HashSet<String>>
Referrals.
In the current implementation, all referrals received during a Search operation will be accumulated in this vector.
ctrls: Vec<Control>
Response controls.
Missing and empty controls are both represented by an empty vector.
Methods
impl LdapResult
[src]
fn success(self) -> Result<Self, Error>
If the result code is zero, return the instance itself wrapped
in Ok()
, otherwise wrap the instance in an io::Error
.
fn non_error(self) -> Result<Self, 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]
fn clone(&self) -> LdapResult
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for LdapResult
[src]
impl Error for LdapResult
[src]
fn description(&self) -> &'static str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
1.0.0
The lower-level cause of this error, if any. Read more