pub enum FormatError {
Show 13 variants
BadMagic {
found: [u8; 4],
},
UnsupportedAbi(u32),
Truncated,
LimitExceeded {
what: &'static str,
got: u32,
},
BadUtf8,
UnknownValueTag(u8),
UnknownMapKey(u8),
NonCanonicalBool(u8),
UnknownOpcode {
at: usize,
byte: u8,
},
ForbiddenConstant(ConstantKind),
ValueTooNested,
DuplicateMapKey,
Trailing {
leftover: usize,
},
}Expand description
Why a .bf buffer failed to decode.
Variants§
BadMagic
UnsupportedAbi(u32)
Truncated
LimitExceeded
BadUtf8
UnknownValueTag(u8)
UnknownMapKey(u8)
The byte after a map tag is not a key kind (0 = Int, 1 = Str).
This used to be reported as FormatError::UnknownValueTag(10),
which is the map’s own tag.
NonCanonicalBool(u8)
Tag 1 was followed by a byte other than 0 or 1. The encoder
writes only those two. Any other byte used to decode as true.
UnknownOpcode
ForbiddenConstant(ConstantKind)
ValueTooNested
DuplicateMapKey
A map constant repeats a key. Value::try_map also rejects this,
but the decoder used to report it as FormatError::ValueTooNested.
Trailing
Bytes left after a complete module. Ignoring them would accept a buffer that is not the module the caller hashed or transmitted.
Trait Implementations§
Source§impl Clone for FormatError
impl Clone for FormatError
Source§impl Debug for FormatError
impl Debug for FormatError
Source§impl Display for FormatError
impl Display for FormatError
impl Eq for FormatError
Source§impl Error for FormatError
impl Error for FormatError
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()
Source§impl PartialEq for FormatError
impl PartialEq for FormatError
impl StructuralPartialEq for FormatError
Auto Trait Implementations§
impl Freeze for FormatError
impl RefUnwindSafe for FormatError
impl Send for FormatError
impl Sync for FormatError
impl Unpin for FormatError
impl UnsafeUnpin for FormatError
impl UnwindSafe for FormatError
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
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.