Enum ldap_parser::error::LdapError
source · [−]pub enum LdapError {
InvalidString,
InvalidAuthenticationType,
InvalidDN,
InvalidSubstring,
InvalidFilterType,
InvalidMessageType,
Unknown,
Ber(Error),
NomError(ErrorKind),
}Expand description
An error that can occur while parsing or validating a certificate.
Variants
InvalidString
InvalidAuthenticationType
InvalidDN
InvalidSubstring
InvalidFilterType
InvalidMessageType
Unknown
Ber(Error)
NomError(ErrorKind)
Trait Implementations
sourceimpl Error for LdapError
impl Error for LdapError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl<'a> FromBer<'a, LdapError> for AttributeValueAssertion<'a>
impl<'a> FromBer<'a, LdapError> for AttributeValueAssertion<'a>
sourceimpl<'a> FromBer<'a, LdapError> for PartialAttribute<'a>
impl<'a> FromBer<'a, LdapError> for PartialAttribute<'a>
sourceimpl<'a> FromBer<'a, LdapError> for BindRequest<'a>
impl<'a> FromBer<'a, LdapError> for BindRequest<'a>
sourceimpl<'a> FromBer<'a, LdapError> for BindResponse<'a>
impl<'a> FromBer<'a, LdapError> for BindResponse<'a>
sourceimpl<'a> FromBer<'a, LdapError> for SearchRequest<'a>
impl<'a> FromBer<'a, LdapError> for SearchRequest<'a>
sourceimpl<'a> FromBer<'a, LdapError> for SearchResultEntry<'a>
impl<'a> FromBer<'a, LdapError> for SearchResultEntry<'a>
sourceimpl<'a> FromBer<'a, LdapError> for ModifyRequest<'a>
impl<'a> FromBer<'a, LdapError> for ModifyRequest<'a>
sourceimpl<'a> FromBer<'a, LdapError> for AddRequest<'a>
impl<'a> FromBer<'a, LdapError> for AddRequest<'a>
sourceimpl<'a> FromBer<'a, LdapError> for ModDnRequest<'a>
impl<'a> FromBer<'a, LdapError> for ModDnRequest<'a>
sourceimpl<'a> FromBer<'a, LdapError> for CompareRequest<'a>
impl<'a> FromBer<'a, LdapError> for CompareRequest<'a>
sourceimpl<'a> FromBer<'a, LdapError> for ExtendedRequest<'a>
impl<'a> FromBer<'a, LdapError> for ExtendedRequest<'a>
sourceimpl<'a> FromBer<'a, LdapError> for ExtendedResponse<'a>
impl<'a> FromBer<'a, LdapError> for ExtendedResponse<'a>
sourceimpl<'a> FromBer<'a, LdapError> for IntermediateResponse<'a>
impl<'a> FromBer<'a, LdapError> for IntermediateResponse<'a>
sourceimpl<'a> FromBer<'a, LdapError> for AuthenticationChoice<'a>
impl<'a> FromBer<'a, LdapError> for AuthenticationChoice<'a>
sourceimpl<'a> FromBer<'a, LdapError> for LdapString<'a>
impl<'a> FromBer<'a, LdapError> for LdapString<'a>
sourceimpl<'a> FromBer<'a, LdapError> for RelativeLdapDN<'a>
impl<'a> FromBer<'a, LdapError> for RelativeLdapDN<'a>
sourceimpl<'a> FromBer<'a, LdapError> for LdapMessage<'a>
impl<'a> FromBer<'a, LdapError> for LdapMessage<'a>
Parse a single LDAP message and return a structure borrowing fields from the input buffer
use ldap_parser::FromBer;
use ldap_parser::ldap::{LdapMessage, MessageID, ProtocolOp, ProtocolOpTag};
static DATA: &[u8] = include_bytes!("../assets/message-search-request-01.bin");
let res = LdapMessage::from_ber(DATA);
match res {
Ok((rem, msg)) => {
assert!(rem.is_empty());
//
assert_eq!(msg.message_id, MessageID(4));
assert_eq!(msg.protocol_op.tag(), ProtocolOpTag::SearchRequest);
match msg.protocol_op {
ProtocolOp::SearchRequest(req) => {
assert_eq!(req.base_object.0, "dc=rccad,dc=net");
},
_ => panic!("Unexpected message type"),
}
},
_ => panic!("LDAP parsing failed: {:?}", res),
}sourceimpl<I, E> FromExternalError<I, E> for LdapError
impl<I, E> FromExternalError<I, E> for LdapError
sourcefn from_external_error(_input: I, kind: ErrorKind, _e: E) -> LdapError
fn from_external_error(_input: I, kind: ErrorKind, _e: E) -> LdapError
Creates a new error from an input position, an [ErrorKind] indicating the wrapping parser, and an external error Read more
sourceimpl<I> ParseError<I> for LdapError
impl<I> ParseError<I> for LdapError
sourcefn from_error_kind(_input: I, kind: ErrorKind) -> Self
fn from_error_kind(_input: I, kind: ErrorKind) -> Self
Creates an error from the input position and an [ErrorKind]
sourcefn append(_input: I, kind: ErrorKind, _other: Self) -> Self
fn append(_input: I, kind: ErrorKind, _other: Self) -> Self
Combines an existing error with a new one created from the input position and an [ErrorKind]. This is useful when backtracking through a parse tree, accumulating error context on the way Read more
impl StructuralPartialEq for LdapError
Auto Trait Implementations
impl RefUnwindSafe for LdapError
impl Send for LdapError
impl Sync for LdapError
impl Unpin for LdapError
impl UnwindSafe for LdapError
Blanket Implementations
sourceimpl<'a, T, E> AsTaggedExplicit<'a, E> for T where
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for T where
T: 'a,
sourceimpl<'a, T, E> AsTaggedImplicit<'a, E> for T where
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for T where
T: 'a,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more