#[non_exhaustive]pub enum PointerWidth {
U16,
U32,
U64,
Other(String),
}
Expand description
The endianness of the target architecture.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
U16
16-bit pointer width.
16
U32
32-bit pointer width.
32
U64
64-bit pointer width.
64
Other(String)
Unknown value
Implementations§
Source§impl PointerWidth
impl PointerWidth
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
String representing this target pointer width which matches #[cfg(target_pointer_width)]
Sourcepub fn from_str<'a>(name: impl Into<Cow<'a, str>>) -> Self
pub fn from_str<'a>(name: impl Into<Cow<'a, str>>) -> Self
Tries to parse the given string as a PointerWidth
falling back to PointerWidth::Other
for unknown values.
Source§impl PointerWidth
impl PointerWidth
Sourcepub fn target() -> Self
pub fn target() -> Self
Gets the current target PointerWidth
.
Trait Implementations§
Source§impl AsRef<str> for PointerWidth
impl AsRef<str> for PointerWidth
Source§impl Clone for PointerWidth
impl Clone for PointerWidth
Source§fn clone(&self) -> PointerWidth
fn clone(&self) -> PointerWidth
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PointerWidth
impl Debug for PointerWidth
Source§impl Display for PointerWidth
impl Display for PointerWidth
Source§impl From<u8> for PointerWidth
impl From<u8> for PointerWidth
Source§impl Hash for PointerWidth
impl Hash for PointerWidth
Source§impl Ord for PointerWidth
impl Ord for PointerWidth
Source§fn cmp(&self, other: &PointerWidth) -> Ordering
fn cmp(&self, other: &PointerWidth) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PointerWidth
impl PartialEq for PointerWidth
Source§impl PartialOrd for PointerWidth
impl PartialOrd for PointerWidth
Source§impl TryFrom<PointerWidth> for u8
impl TryFrom<PointerWidth> for u8
Source§type Error = ParseIntError
type Error = ParseIntError
The type returned in the event of a conversion error.
impl Eq for PointerWidth
impl StructuralPartialEq for PointerWidth
Auto Trait Implementations§
impl Freeze for PointerWidth
impl RefUnwindSafe for PointerWidth
impl Send for PointerWidth
impl Sync for PointerWidth
impl Unpin for PointerWidth
impl UnwindSafe for PointerWidth
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