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)>
Returns 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>
Parse a single LDAP message and return a structure borrowing fields from the input buffer
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§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
impl StructuralPartialEq for LdapError
Auto Trait Implementations§
impl Freeze for LdapError
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