#[non_exhaustive]pub enum PointerWidth<'a> {
U16,
U32,
U64,
Other(Cow<'a, str>),
}
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(Cow<'a, str>)
Unknown value
Implementations§
Source§impl<'a> PointerWidth<'a>
impl<'a> PointerWidth<'a>
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(name: impl Into<Cow<'a, str>>) -> Self
pub fn from_str(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() -> Result<Self, VarError>
pub fn target() -> Result<Self, VarError>
Gets the current target PointerWidth
.
Trait Implementations§
Source§impl<'a> Clone for PointerWidth<'a>
impl<'a> Clone for PointerWidth<'a>
Source§fn clone(&self) -> PointerWidth<'a>
fn clone(&self) -> PointerWidth<'a>
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<'a> Debug for PointerWidth<'a>
impl<'a> Debug for PointerWidth<'a>
Source§impl Display for PointerWidth<'_>
impl Display for PointerWidth<'_>
Source§impl From<u8> for PointerWidth<'_>
impl From<u8> for PointerWidth<'_>
Source§impl<'a> Hash for PointerWidth<'a>
impl<'a> Hash for PointerWidth<'a>
Source§impl<'a> Ord for PointerWidth<'a>
impl<'a> Ord for PointerWidth<'a>
Source§fn cmp(&self, other: &PointerWidth<'a>) -> Ordering
fn cmp(&self, other: &PointerWidth<'a>) -> 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<'a> PartialEq for PointerWidth<'a>
impl<'a> PartialEq for PointerWidth<'a>
Source§impl<'a> PartialOrd for PointerWidth<'a>
impl<'a> PartialOrd for PointerWidth<'a>
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<'a> Eq for PointerWidth<'a>
impl<'a> StructuralPartialEq for PointerWidth<'a>
Auto Trait Implementations§
impl<'a> Freeze for PointerWidth<'a>
impl<'a> RefUnwindSafe for PointerWidth<'a>
impl<'a> Send for PointerWidth<'a>
impl<'a> Sync for PointerWidth<'a>
impl<'a> Unpin for PointerWidth<'a>
impl<'a> UnwindSafe for PointerWidth<'a>
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