pub enum Error {
Show 21 variants
BerTypeError,
BerValueError,
InvalidLength,
InvalidValue {
tag: Tag,
msg: String,
},
InvalidTag,
UnknownTag(u32),
UnexpectedTag {
expected: Option<Tag>,
actual: Tag,
},
UnexpectedClass {
expected: Option<Class>,
actual: Class,
},
IndefiniteLengthUnexpected,
ConstructExpected,
ConstructUnexpected,
IntegerTooLarge,
IntegerNegative,
BerMaxDepth,
StringInvalidCharset,
InvalidDateTime,
DerConstraintFailed(DerConstraint),
LifetimeError,
Unsupported,
Incomplete(Needed),
NomError(ErrorKind),
}
Variants
BerTypeError
BER object does not have the expected type
BerValueError
BER object does not have the expected value
InvalidLength
Invalid Length
InvalidValue
Invalid Value when parsing object with tag {tag:?} {msg:}
InvalidTag
Invalid Tag
UnknownTag(u32)
Unknown tag: {0:?}
UnexpectedTag
Unexpected Tag (expected: {expected:?}, actual: {actual:?})
UnexpectedClass
Unexpected Class (expected: {expected:?}, actual: {actual:?})
IndefiniteLengthUnexpected
Indefinite length not allowed
ConstructExpected
DER object was expected to be constructed (and found to be primitive)
ConstructUnexpected
DER object was expected to be primitive (and found to be constructed)
IntegerTooLarge
Integer too large to fit requested type
IntegerNegative
BER integer is negative, while an unsigned integer was requested
BerMaxDepth
BER recursive parsing reached maximum depth
StringInvalidCharset
Invalid encoding or forbidden characters in string
InvalidDateTime
Invalid Date or Time
DerConstraintFailed(DerConstraint)
DER Failed constraint
LifetimeError
Requesting borrowed data from a temporary object
Unsupported
Feature is not yet implemented
Incomplete(Needed)
incomplete data, missing: {0:?}
NomError(ErrorKind)
nom error: {0:?}
Implementations
sourceimpl Error
impl Error
sourcepub const fn invalid_value(tag: Tag, msg: String) -> Self
pub const fn invalid_value(tag: Tag, msg: String) -> Self
Build an error from the provided invalid value
sourcepub const fn unexpected_class(expected: Option<Class>, actual: Class) -> Self
pub const fn unexpected_class(expected: Option<Class>, actual: Class) -> Self
Build an error from the provided unexpected class
sourcepub const fn unexpected_tag(expected: Option<Tag>, actual: Tag) -> Self
pub const fn unexpected_tag(expected: Option<Tag>, actual: Tag) -> Self
Build an error from the provided unexpected tag
Trait Implementations
sourceimpl Error for Error
impl Error for Error
1.30.0 · 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>
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
use the Display impl or to_string()
sourceimpl From<Error> for SerializeError
impl From<Error> for SerializeError
sourceimpl From<FromUtf16Error> for Error
impl From<FromUtf16Error> for Error
sourcefn from(_: FromUtf16Error) -> Self
fn from(_: FromUtf16Error) -> Self
Converts to this type from the input type.
sourceimpl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
sourcefn from(_: FromUtf8Error) -> Self
fn from(_: FromUtf8Error) -> Self
Converts to this type from the input type.
sourceimpl<'a> FromBer<'a, Error> for Any<'a>
impl<'a> FromBer<'a, Error> for Any<'a>
sourcefn from_ber(bytes: &'a [u8]) -> ParseResult<'_, Self>
fn from_ber(bytes: &'a [u8]) -> ParseResult<'_, Self>
Attempt to parse input bytes into a BER object
sourceimpl<'a, T> FromBer<'a, Error> for Option<T> where
T: FromBer<'a>,
impl<'a, T> FromBer<'a, Error> for Option<T> where
T: FromBer<'a>,
sourcefn from_ber(bytes: &'a [u8]) -> ParseResult<'_, Self>
fn from_ber(bytes: &'a [u8]) -> ParseResult<'_, Self>
Attempt to parse input bytes into a BER object
sourceimpl<'a> FromBer<'a, Error> for Header<'a>
impl<'a> FromBer<'a, Error> for Header<'a>
sourcefn from_ber(bytes: &'a [u8]) -> ParseResult<'_, Self>
fn from_ber(bytes: &'a [u8]) -> ParseResult<'_, Self>
Attempt to parse input bytes into a BER object
sourceimpl<'a> FromDer<'a, Error> for Any<'a>
impl<'a> FromDer<'a, Error> for Any<'a>
sourcefn from_der(bytes: &'a [u8]) -> ParseResult<'_, Self>
fn from_der(bytes: &'a [u8]) -> ParseResult<'_, Self>
Attempt to parse input bytes into a DER object (enforcing constraints)
sourceimpl<'a, T> FromDer<'a, Error> for Option<T> where
T: FromDer<'a>,
impl<'a, T> FromDer<'a, Error> for Option<T> where
T: FromDer<'a>,
sourcefn from_der(bytes: &'a [u8]) -> ParseResult<'_, Self>
fn from_der(bytes: &'a [u8]) -> ParseResult<'_, Self>
Attempt to parse input bytes into a DER object (enforcing constraints)
sourceimpl<'a> FromDer<'a, Error> for Header<'a>
impl<'a> FromDer<'a, Error> for Header<'a>
sourcefn from_der(bytes: &'a [u8]) -> ParseResult<'_, Self>
fn from_der(bytes: &'a [u8]) -> ParseResult<'_, Self>
Attempt to parse input bytes into a DER object (enforcing constraints)
sourceimpl<I, E> FromExternalError<I, E> for Error
impl<I, E> FromExternalError<I, E> for Error
sourceimpl<'a> ParseError<&'a [u8]> for Error
impl<'a> ParseError<&'a [u8]> for Error
sourcefn from_error_kind(_input: &'a [u8], kind: ErrorKind) -> Self
fn from_error_kind(_input: &'a [u8], kind: ErrorKind) -> Self
Creates an error from the input position and an ErrorKind
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
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