pub enum Error {
Empty,
UnknownArch(String),
UnknownOs(String),
UnknownEnv(String),
Trailing(Vec<String>),
BadVersion {
component: &'static str,
found: String,
},
SubArchMismatch {
arch: Arch,
sub_arch: SubArch,
},
EndianUnsupported {
arch: Arch,
endian: Endian,
},
EnvMismatch {
os: Os,
env: Env,
},
AbiMismatch {
arch: Arch,
abi: Abi,
},
VersionNotAccepted {
component: &'static str,
},
}Expand description
A tuple that could not be read, or that was read and does not describe a machine.
Every variant names the component it is unhappy about. That is the whole design goal of this
type: the model this replaces had a catch-all arm that skipped anything it did not recognize,
so x86_64-linux-gnu.2.28 parsed as x86_64-linux-gnu and the version was thrown away with
no diagnostic. A user who pins a glibc version and gets the host’s is not going to find out
until the binary fails on the target machine.
Variants§
Empty
The tuple was empty or all separators.
UnknownArch(String)
The leading component is not an architecture we know.
UnknownOs(String)
The OS component is not an OS we know.
UnknownEnv(String)
The environment component is not an environment we know.
Trailing(Vec<String>)
Components were left over after the environment was read.
This is the case the old catch-all silently ate, so it is an error with the leftovers quoted rather than a shrug.
BadVersion
A version was attached to a component and could not be read as one.
Fields
SubArchMismatch
A sub-architecture was named that does not belong to the architecture.
Fields
EndianUnsupported
A byte order was named that the architecture does not have.
EnvMismatch
An environment was named that the OS does not have.
AbiMismatch
A float ABI was named for an architecture that has one calling convention.
VersionNotAccepted
A version was attached to a component that does not take one.
x86_64-linux.5.15-gnu is not a request for a kernel version, it is a mistake, and
accepting it would mean the tuple carries a field nothing reads.
Trait Implementations§
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()