#[non_exhaustive]pub enum Error {
Truncated {
needed: usize,
available: usize,
},
BufferFull {
needed: usize,
available: usize,
},
LengthOverflow,
NotUtf8,
Malformed(&'static str),
UnsupportedVersion {
tag: Tag,
version: u16,
},
}Expand description
What went wrong while reading or writing an ABI record.
Every variant is a fact about the bytes rather than an opinion about them. Deciding what to do about a malformed record is the caller’s job, because the host and the guest have very different options available to them.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
The buffer ended before the value did.
BufferFull
There was not enough room left in the output buffer.
LengthOverflow
A length field described more bytes than can be addressed on this target.
NotUtf8
A field that is declared to be text was not valid UTF-8.
Malformed(&'static str)
The bytes parsed but do not describe a record this code can make sense of.
Tuple Fields
UnsupportedVersion
The record is one we know, at a version we do not.
This is not the same as an unknown tag. An unknown tag is skipped, because that is what makes the format extensible. A known tag at an unknown version is a real disagreement and the reader has to say so.
Trait Implementations§
impl Copy for Error
impl Eq for Error
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()