pub enum Error {
BufferFull,
InvalidTag(u8),
InvalidUtf8,
ScopeMismatch {
expected: Scope,
actual: Scope,
},
ScopeUnderflow,
ScopeStillOpen,
UnexpectedEnd,
BlobTooLarge(usize),
TooManyItems(Scope),
EmptyAdt(Scope),
InvalidMapEntry,
}Expand description
Neopack serialization and deserialization errors.
Variants§
BufferFull
Internal buffer capacity exceeded.
InvalidTag(u8)
Byte does not correspond to a valid Neopack Tag.
InvalidUtf8
String data is not valid UTF-8.
ScopeMismatch
Closing a scope that does not match the active scope stack.
ScopeUnderflow
Attempted to close a scope when only the Root remains.
ScopeStillOpen
Attempted to finalize the buffer with open scopes.
UnexpectedEnd
Buffer exhausted while reading.
BlobTooLarge(usize)
Blob or container length exceeds u32::MAX.
TooManyItems(Scope)
Structural Violation: Attempted to write >1 item into a strict scope (Option/Result/Variant).
EmptyAdt(Scope)
Structural Violation: Attempted to close a strict scope (Option/Result/Variant) without a value.
InvalidMapEntry
Structural Violation: Attempted to write a non-Variant directly into a Map.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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