doc.rust-lang.org
pub const unsafe fn byte_offset_from_unsigned<U>(self, origin: *const U) -> usize
Calculates the distance between two pointers within the same allocation, where it's known that self is equal to or greater than origin. The returned value is in units of bytes.
method
core
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn byte_offset_from<U>(self, origin: *const U) -> isize
Calculates the distance between two pointers within the same allocation. The returned value is in units of bytes.
method
core
Stable since 1.75.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn byte_offset(self, count: isize) -> Self
Adds a signed offset in bytes to a pointer.
method
core
Stable since 1.75.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn byte_add(self, count: usize) -> Self
Adds an unsigned offset in bytes to a pointer.
method
core
Stable since 1.75.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn as_ref_unchecked<'a>(self) -> &'a T
Returns a shared reference to the value behind the pointer. If the pointer may be null or the value may be uninitialized, as_uninit_ref must be used instead. If the pointer may be null, but the value is known to have been initialized, as_ref must be used instead.
method
core
Stable since 1.95.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn as_ref<'a>(self) -> Option<&'a T>
Returns None if the pointer is null, or else returns a shared reference to the value wrapped in Some. If the value may be uninitialized, as_uninit_ref must be used instead. If the value is known to be non-null, as_ref_unchecked can be used instead.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn as_mut_unchecked<'a>(self) -> &'a mut T
Returns a unique reference to the value behind the pointer. If the pointer may be null or the value may be uninitialized, as_uninit_mut must be used instead. If the pointer may be null, but the value is known to have been initialized, as_mut must be used instead.
method
core
Stable since 1.95.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_mut_array<const N: usize>(self) -> Option<*mut [T; N]>
Gets a raw, mutable pointer to the underlying array.
method
core
Stable since 1.93.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn as_mut<'a>(self) -> Option<&'a mut T>
Returns None if the pointer is null, or else returns a unique reference to the value wrapped in Some. If the value may be uninitialized, as_uninit_mut must be used instead. If the value is known to be non-null, as_mut_unchecked can be used instead.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_array<const N: usize>(self) -> Option<*const [T; N]>
Gets a raw pointer to the underlying array.
method
core
Stable since 1.93.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn align_offset(self, align: usize) -> usize
Computes the offset that needs to be applied to the pointer in order to make it aligned to align.
method
core
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn addr(self) -> usize
Gets the "address" portion of the pointer.
method
core
Stable since 1.84.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn add(self, count: usize) -> Self
Adds an unsigned offset to a pointer.
method
core
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
primitive pointer
Raw, unsafe pointers, *const T, and *mut T.
primitive
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub macro pin!
Constructs a Pin<&mut T>, by pinning a value: T locally.
macro
core
Stable since 1.68.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn static_ref(r: &'static T) -> Pin<&'static T>
Gets a pinning reference from a &'static reference.
associated_function
core
Stable since 1.61.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn static_mut(r: &'static mut T) -> Pin<&'static mut T>
Gets a pinning mutable reference from a static mutable reference.
associated_function
core
Stable since 1.61.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn set(&mut self, value: <Ptr as >::Target)
Assigns a new value to the memory location pointed to by the Pin<Ptr>.
method
core
Stable since 1.33.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn new_unchecked(pointer: Ptr) -> Pin<Ptr>
Constructs a new Pin<Ptr> around a reference to some data of a type that may or may not implement Unpin.
associated_function
core
Stable since 1.33.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(pointer: Ptr) -> Pin<Ptr>
Constructs a new Pin<Ptr> around a pointer to some data of a type that implements Unpin.
associated_function
core
Stable since 1.33.0
Version 1.100.0-nightly