Enum symbolic::common::Arch [−][src]
#[repr(u32)]
#[non_exhaustive]
pub enum Arch {
Show 29 variants
Unknown,
X86,
X86Unknown,
Amd64,
Amd64h,
Amd64Unknown,
Arm,
ArmV5,
ArmV6,
ArmV6m,
ArmV7,
ArmV7f,
ArmV7s,
ArmV7k,
ArmV7m,
ArmV7em,
ArmUnknown,
Arm64,
Arm64V8,
Arm64e,
Arm64Unknown,
Ppc,
Ppc64,
Mips,
Mips64,
Arm64_32,
Arm64_32V8,
Arm64_32Unknown,
Wasm32,
}
Expand description
An enumeration of CPU architectures and variants.
The architectues are grouped into families, which can be retrieved by cpu_family
. There are
*Unknown
variants for each architecture to maintain forward-compatibility. This allows to
support architectures where the family is known but the subtype is not.
Each architecture has a canonical name, returned by Arch::name
. Likewise, architectures can
be parsed from their string names. In addition to that, in some cases aliases are supported. For
instance, "x86"
is aliased as "i386"
.
This enumeration is represented as u32
for C-bindings and lowlevel APIs. The values are
grouped by CPU family for forward compatibility.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Implementations
Creates an Arch
from its u32
representation.
Returns Arch::Unknown
for all unknown values.
Examples
use symbolic_common::Arch;
// Will print "X86"
println!("{:?}", Arch::from_u32(101));
Returns the CPU family of the CPU architecture.
Examples
use symbolic_common::Arch;
// Will print "Intel32"
println!("{:?}", Arch::X86.cpu_family());
Returns the canonical name of the CPU architecture.
This follows the Apple conventions for naming architectures. For instance, Intel 32-bit
architectures are canonically named "x86"
, even though "i386"
would also be a valid
name.
For architectures with variants or subtypes, that subtype is encoded into the name. For instance the ARM v7-M architecture is named with a full `“armv7m”.
Examples
use symbolic_common::Arch;
// Will print "x86"
println!("{}", Arch::X86.name());
Returns whether this architecture is well-known.
This is trivially true
for all architectures other than the *Unknown
variants.
Examples
use symbolic_common::Arch;
assert!(Arch::X86.well_known());
assert!(!Arch::X86Unknown.well_known());
Trait Implementations
pub fn deserialize<D>(
deserializer: D
) -> Result<Arch, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<Arch, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
type Err = UnknownArchError
type Err = UnknownArchError
The associated error which can be returned from parsing.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Arch
impl UnwindSafe for Arch
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
pub fn extract_context(self, _original_input: I)
pub fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
impl<T> Indentable for T where
T: Display,
impl<T> Indentable for T where
T: Display,
fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
pub fn recreate_context(_original_input: I, tail: I) -> I
pub fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more