pub enum CodecError {
WrongType,
IntegerOverflow,
NotFinite,
FloatRange,
NotUtf8,
WrongArity,
UnknownTermType,
}Expand description
Error returned by term type conversion operations.
otter’s internal error type — it never appears in user NIF signatures. The
#[otter::nif] macro converts codec failures to badarg automatically.
Variants§
WrongType
The term was not the expected type.
IntegerOverflow
An integer term did not fit the requested Rust integer type.
NotFinite
A float value could not be represented as an Erlang float because it is not finite (NaN or infinity) — an encode-side failure.
FloatRange
A finite float term fell outside the finite range of the requested Rust
float type (only f32, on decode).
NotUtf8
A binary’s bytes were not valid UTF-8, or a list was not a valid string,
when decoding to a Rust String.
WrongArity
An Erlang tuple’s arity did not match the arity of the Rust tuple type it was being decoded into.
UnknownTermType
The term’s type code is one this otter build does not recognize — a term type added by a newer OTP than otter knows about.
Trait Implementations§
Source§impl Clone for CodecError
impl Clone for CodecError
Source§fn clone(&self) -> CodecError
fn clone(&self) -> CodecError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CodecError
Source§impl Debug for CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
impl Eq 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 PartialEq for CodecError
impl PartialEq for CodecError
Source§fn eq(&self, other: &CodecError) -> bool
fn eq(&self, other: &CodecError) -> bool
self and other values to be equal, and is used by ==.