Enum spacetimedb_sats::buffer::DecodeError
source · pub enum DecodeError {
BufferLength {
for_type: String,
expected: usize,
given: usize,
},
InvalidTag,
InvalidUtf8,
Other(String),
}
Expand description
An error that occurred when decoding.
Variants§
BufferLength
Not enough data was provided in the input.
InvalidTag
The tag does not exist for the sum.
InvalidUtf8
Expected data to be UTF-8 but it wasn’t.
Other(String)
Custom error not in the other variants of DecodeError
.
Trait Implementations§
source§impl Clone for DecodeError
impl Clone for DecodeError
source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DecodeError
impl Debug for DecodeError
source§impl Display for DecodeError
impl Display for DecodeError
source§impl Error for DecodeError
impl Error for DecodeError
1.30.0 · 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 Error for DecodeError
impl Error for DecodeError
source§fn custom(msg: impl Display) -> Self
fn custom(msg: impl Display) -> Self
Raised when there is general error when deserializing a type.
source§fn unknown_variant_tag<'de, T: SumVisitor<'de>>(_tag: u8, _expected: &T) -> Self
fn unknown_variant_tag<'de, T: SumVisitor<'de>>(_tag: u8, _expected: &T) -> Self
The
tag
does not specify a variant of the sum type.source§fn invalid_product_length<'de, T: ProductVisitor<'de>>(
len: usize,
expected: &T
) -> Self
fn invalid_product_length<'de, T: ProductVisitor<'de>>( len: usize, expected: &T ) -> Self
The product length was not as promised.
source§fn missing_field<'de, T: ProductVisitor<'de>>(
index: usize,
field_name: Option<&str>,
prod: &T
) -> Self
fn missing_field<'de, T: ProductVisitor<'de>>( index: usize, field_name: Option<&str>, prod: &T ) -> Self
There was a missing field at
index
.source§fn duplicate_field<'de, T: ProductVisitor<'de>>(
index: usize,
field_name: Option<&str>,
prod: &T
) -> Self
fn duplicate_field<'de, T: ProductVisitor<'de>>( index: usize, field_name: Option<&str>, prod: &T ) -> Self
A field with
index
was specified more than once.source§fn unknown_field_name<'de, T: FieldNameVisitor<'de>>(
field_name: &str,
expected: &T
) -> Self
fn unknown_field_name<'de, T: FieldNameVisitor<'de>>( field_name: &str, expected: &T ) -> Self
A field with name
field_name
does not exist.source§fn unknown_variant_name<T: VariantVisitor>(name: &str, expected: &T) -> Self
fn unknown_variant_name<T: VariantVisitor>(name: &str, expected: &T) -> Self
The
name
is not that of a variant of the sum type.source§impl From<DecodeError> for LibError
impl From<DecodeError> for LibError
source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
source§impl From<DecodeError> for String
impl From<DecodeError> for String
source§fn from(err: DecodeError) -> Self
fn from(err: DecodeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnwindSafe for DecodeError
Blanket Implementations§
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