pub trait PointerInt:
Copy
+ Into<u64>
+ TryFrom<u64>
+ TryFrom<usize> {
// Required method
fn ptr_from_u64(v: u64) -> u64;
// Provided method
fn ptr_from_usize(v: usize) -> Result<u64, FormatValueError> { ... }
}Expand description
Trait implemented by target platform pointer-sized unsigned integer types
(e.g., u32 on ILP32, u64 on LP64/LLP64).
Required Methods§
Sourcefn ptr_from_u64(v: u64) -> u64
fn ptr_from_u64(v: u64) -> u64
Converts a 64-bit unsigned integer into the target platform’s pointer width.
Provided Methods§
Sourcefn ptr_from_usize(v: usize) -> Result<u64, FormatValueError>
fn ptr_from_usize(v: usize) -> Result<u64, FormatValueError>
Converts a host usize pointer address to a u64 target pointer value,
returning an error if the address exceeds the target platform’s pointer
range.
§Errors
Returns FormatValueError::ValueOutOfRange if v exceeds the target
platform’s pointer width.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".