#[non_exhaustive]pub enum CodecError {
Show 14 variants
UnexpectedEof {
needed: usize,
},
BadMagic,
UnsupportedVersion(u8),
LengthOverflow {
claimed: u64,
remaining: usize,
},
CountOverflow {
claimed: u64,
max: usize,
},
InvalidUtf8,
InvalidBool(u8),
InvalidOption(u8),
InvalidChar(u32),
UnknownVariant(u32),
MissingLen,
TrailingBytes(usize),
SelfDescribing,
Message(String),
}Expand description
Errors returned by the event-store positional codec.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedEof
The input ended before the requested bytes could be read.
BadMagic
The frame did not start with the event-store codec magic.
UnsupportedVersion(u8)
The frame version is not supported by this decoder.
LengthOverflow
An encoded byte length would exceed the remaining input.
Fields
CountOverflow
An encoded collection count exceeded the supported maximum.
Fields
InvalidUtf8
A string was not valid UTF-8.
InvalidBool(u8)
A bool discriminant was not 0x00 or 0x01.
InvalidOption(u8)
An option discriminant was not 0x00 or 0x01.
InvalidChar(u32)
A decoded char value was not a valid Unicode scalar value.
UnknownVariant(u32)
An enum variant index was outside the type’s variant set.
MissingLen
Serde did not provide a sequence or map length.
TrailingBytes(usize)
The input had bytes remaining after a complete value was decoded.
SelfDescribing
The caller attempted self-describing deserialization.
Message(String)
Serde-generated error message.
Trait Implementations§
Source§impl Debug for CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
Source§impl Error for CodecError
impl Error for CodecError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl Error for CodecError
impl Error for CodecError
Source§impl Error for CodecError
impl Error for CodecError
Source§fn custom<T: Display>(msg: T) -> Self
fn custom<T: Display>(msg: T) -> Self
Source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a type different from what it was
expecting. Read moreSource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a value of the right type but that
is wrong for some other reason. Read moreSource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Deserialize enum type received a variant with an
unrecognized name.Source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Deserialize struct type received a field with an
unrecognized name.Source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Deserialize struct type expected to receive a required
field with a particular name but that field was not present in the
input.Source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Deserialize struct type received more than one of the
same field.Auto Trait Implementations§
impl Freeze for CodecError
impl RefUnwindSafe for CodecError
impl Send for CodecError
impl Sync for CodecError
impl Unpin for CodecError
impl UnsafeUnpin for CodecError
impl UnwindSafe for CodecError
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more