#[non_exhaustive]pub enum CompactError {
UnknownSchema(SchemaId),
BundleSchemaIdMismatch {
stated: SchemaId,
recomputed: SchemaId,
},
Unsupported(&'static str),
TypeMismatch {
expected: &'static str,
},
UnknownVariant(String),
BadVariantIndex(u32),
GenericArity {
params: usize,
args: usize,
},
Malformed(&'static str),
Incompatible(String),
WriterOnlyVariant(u32),
Decode(DecodeError),
Encode(EncodeError),
}Expand description
Why a compact encode or decode failed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnknownSchema(SchemaId)
A referenced schema id is not in the registry (r[schema-identity.unknown-is-error]).
BundleSchemaIdMismatch
A received schema bundle member’s stated id did not match its content hash.
Unsupported(&'static str)
A kind or feature not yet implemented in this codec.
TypeMismatch
The value’s shape does not match the schema it is being encoded against.
UnknownVariant(String)
An enum value names a variant the schema does not have.
BadVariantIndex(u32)
A decoded enum variant index is out of range.
GenericArity
A generic schema applied with the wrong number of type arguments.
Malformed(&'static str)
A structurally malformed schema (e.g. an unbound type variable, or a primitive carrying type arguments).
Incompatible(String)
Two schemas cannot be translated by a compatibility plan (r[compat.*]).
WriterOnlyVariant(u32)
A decoded enum variant exists in the writer schema but has no counterpart
in the reader schema (r[compat.enum]).
Decode(DecodeError)
A decode-side validation failure from the byte reader.
Encode(EncodeError)
A dynamic (self-describing) sub-value failed to encode.
Trait Implementations§
Source§impl Clone for CompactError
impl Clone for CompactError
Source§fn clone(&self) -> CompactError
fn clone(&self) -> CompactError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompactError
impl Debug for CompactError
Source§impl Display for CompactError
impl Display for CompactError
impl Eq for CompactError
Source§impl Error for CompactError
impl Error for CompactError
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 From<DecodeError> for CompactError
impl From<DecodeError> for CompactError
Source§fn from(e: DecodeError) -> Self
fn from(e: DecodeError) -> Self
Source§impl From<EncodeError> for CompactError
impl From<EncodeError> for CompactError
Source§fn from(e: EncodeError) -> Self
fn from(e: EncodeError) -> Self
Source§impl PartialEq for CompactError
impl PartialEq for CompactError
Source§fn eq(&self, other: &CompactError) -> bool
fn eq(&self, other: &CompactError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CompactError
Auto Trait Implementations§
impl Freeze for CompactError
impl RefUnwindSafe for CompactError
impl Send for CompactError
impl Sync for CompactError
impl Unpin for CompactError
impl UnsafeUnpin for CompactError
impl UnwindSafe for CompactError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.