Enum scale_value::serde::SerializerError
source · pub enum SerializerError {
Custom(String),
CannotSerializeFloats,
MapKeyMustBeStringlike,
}
Expand description
An error that can occur when attempting to serialize a type into a Value
.
Variants§
Custom(String)
Some custom error string.
CannotSerializeFloats
SCALE does not support floating point values, and so we’ll hit this error if we try to encode any floats.
MapKeyMustBeStringlike
SCALE encoding is only designed to map from statically known structs to bytes. We use field names
to figure out this mapping between named composite types and structs, so we don’t support encoding
maps with non-string keys into Value
s.
Trait Implementations§
source§impl Clone for SerializerError
impl Clone for SerializerError
source§fn clone(&self) -> SerializerError
fn clone(&self) -> SerializerError
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 SerializerError
impl Debug for SerializerError
source§impl Display for SerializerError
impl Display for SerializerError
source§impl Error for SerializerError
impl Error for SerializerError
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 SerializerError
impl Error for SerializerError
source§impl PartialEq for SerializerError
impl PartialEq for SerializerError
source§fn eq(&self, other: &SerializerError) -> bool
fn eq(&self, other: &SerializerError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SerializerError
impl StructuralPartialEq for SerializerError
Auto Trait Implementations§
impl Freeze for SerializerError
impl RefUnwindSafe for SerializerError
impl Send for SerializerError
impl Sync for SerializerError
impl Unpin for SerializerError
impl UnwindSafe for SerializerError
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