Enum spacetimedb_lib::buffer::DecodeError
source · pub enum DecodeError {
BufferLength,
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
source§fn custom(msg: impl Display) -> DecodeError
fn custom(msg: impl Display) -> DecodeError
Raised when there is general error when deserializing a type.
source§fn unknown_variant_tag<'de, T>(_tag: u8, _expected: &T) -> DecodeErrorwhere
T: SumVisitor<'de>,
fn unknown_variant_tag<'de, T>(_tag: u8, _expected: &T) -> DecodeErrorwhere
T: SumVisitor<'de>,
The
tag does not specify a variant of the sum type.source§fn invalid_product_length<'de, T>(len: usize, expected: &T) -> Selfwhere
T: ProductVisitor<'de>,
fn invalid_product_length<'de, T>(len: usize, expected: &T) -> Selfwhere
T: ProductVisitor<'de>,
The product length was not as promised.
source§fn missing_field<'de, T>(
index: usize,
field_name: Option<&str>,
prod: &T
) -> Selfwhere
T: ProductVisitor<'de>,
fn missing_field<'de, T>(
index: usize,
field_name: Option<&str>,
prod: &T
) -> Selfwhere
T: ProductVisitor<'de>,
There was a missing field at
index.source§fn duplicate_field<'de, T>(
index: usize,
field_name: Option<&str>,
prod: &T
) -> Selfwhere
T: ProductVisitor<'de>,
fn duplicate_field<'de, T>(
index: usize,
field_name: Option<&str>,
prod: &T
) -> Selfwhere
T: ProductVisitor<'de>,
A field with
index was specified more than once.source§fn unknown_field_name<'de, T>(field_name: &str, expected: &T) -> Selfwhere
T: FieldNameVisitor<'de>,
fn unknown_field_name<'de, T>(field_name: &str, expected: &T) -> Selfwhere
T: FieldNameVisitor<'de>,
A field with name
field_name does not exist.source§fn unknown_variant_name<T>(name: &str, expected: &T) -> Selfwhere
T: VariantVisitor,
fn unknown_variant_name<T>(name: &str, expected: &T) -> Selfwhere
T: VariantVisitor,
The
name is not that of a variant of the sum type.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 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<Utf8Error> for DecodeError
impl From<Utf8Error> for DecodeError
source§fn from(_: Utf8Error) -> DecodeError
fn from(_: Utf8Error) -> DecodeError
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