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§
source§impl Error for LdapError
 
impl Error for LdapError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
 
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
 
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<'a> FromBer<'a, LdapError> for AddRequest<'a>
 
impl<'a> FromBer<'a, LdapError> for AddRequest<'a>
source§impl<'a> FromBer<'a, LdapError> for AttributeValueAssertion<'a>
 
impl<'a> FromBer<'a, LdapError> for AttributeValueAssertion<'a>
source§impl<'a> FromBer<'a, LdapError> for AuthenticationChoice<'a>
 
impl<'a> FromBer<'a, LdapError> for AuthenticationChoice<'a>
source§impl<'a> FromBer<'a, LdapError> for BindRequest<'a>
 
impl<'a> FromBer<'a, LdapError> for BindRequest<'a>
source§impl<'a> FromBer<'a, LdapError> for BindResponse<'a>
 
impl<'a> FromBer<'a, LdapError> for BindResponse<'a>
source§impl<'a> FromBer<'a, LdapError> for CompareRequest<'a>
 
impl<'a> FromBer<'a, LdapError> for CompareRequest<'a>
source§impl<'a> FromBer<'a, LdapError> for ExtendedRequest<'a>
 
impl<'a> FromBer<'a, LdapError> for ExtendedRequest<'a>
source§impl<'a> FromBer<'a, LdapError> for ExtendedResponse<'a>
 
impl<'a> FromBer<'a, LdapError> for ExtendedResponse<'a>
source§impl<'a> FromBer<'a, LdapError> for IntermediateResponse<'a>
 
impl<'a> FromBer<'a, LdapError> for IntermediateResponse<'a>
source§impl<'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),
}source§impl<'a> FromBer<'a, LdapError> for LdapString<'a>
 
impl<'a> FromBer<'a, LdapError> for LdapString<'a>
source§impl<'a> FromBer<'a, LdapError> for ModDnRequest<'a>
 
impl<'a> FromBer<'a, LdapError> for ModDnRequest<'a>
source§impl<'a> FromBer<'a, LdapError> for ModifyRequest<'a>
 
impl<'a> FromBer<'a, LdapError> for ModifyRequest<'a>
source§impl<'a> FromBer<'a, LdapError> for PartialAttribute<'a>
 
impl<'a> FromBer<'a, LdapError> for PartialAttribute<'a>
source§impl<'a> FromBer<'a, LdapError> for RelativeLdapDN<'a>
 
impl<'a> FromBer<'a, LdapError> for RelativeLdapDN<'a>
source§impl<'a> FromBer<'a, LdapError> for SearchRequest<'a>
 
impl<'a> FromBer<'a, LdapError> for SearchRequest<'a>
source§impl<'a> FromBer<'a, LdapError> for SearchResultEntry<'a>
 
impl<'a> FromBer<'a, LdapError> for SearchResultEntry<'a>
source§impl<I, E> FromExternalError<I, E> for LdapError
 
impl<I, E> FromExternalError<I, E> for LdapError
source§fn 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
source§impl<I> ParseError<I> for LdapError
 
impl<I> ParseError<I> for LdapError
source§fn 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]
source§fn 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
source§impl PartialEq for LdapError
 
impl PartialEq for LdapError
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§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more