pub enum CborError {
InvalidEncoding,
UnexpectedStructure,
SerializationFailed,
DeserializationFailed,
InvalidLength,
BufferTooSmall,
InvalidUtf8,
Unsupported,
}Available on crate feature
cbor only.Expand description
CBOR serialization errors
These errors correspond to failure modes in Cardano’s CBOR processing.
§Example
use cardano_crypto::cbor::CborError;
let err = CborError::BufferTooSmall;
let s = format!("{}", err);
assert!(s.len() > 0);Variants§
InvalidEncoding
Invalid CBOR encoding (malformed header or structure)
UnexpectedStructure
Unexpected CBOR structure (wrong major type)
SerializationFailed
Serialization failed
DeserializationFailed
Deserialization failed
InvalidLength
Invalid byte length for the expected type
BufferTooSmall
Buffer too small to hold the data
InvalidUtf8
Invalid UTF-8 in text string
Unsupported
Unsupported CBOR feature or extension
Trait Implementations§
Source§impl Error for CborError
impl Error for CborError
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()
impl Copy for CborError
impl Eq for CborError
impl StructuralPartialEq for CborError
Auto Trait Implementations§
impl Freeze for CborError
impl RefUnwindSafe for CborError
impl Send for CborError
impl Sync for CborError
impl Unpin for CborError
impl UnwindSafe for CborError
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