|
| template<class U > |
| constexpr auto | cast () const noexcept |
| | Casts this NonNull<T> to a NonNull<U>.
|
| |
| constexpr NonNull | add (usize count) const noexcept |
| | Calculates the pointer offset by count elements forward.
|
| |
| constexpr NonNull | sub (usize count) const noexcept |
| | Calculates the pointer offset by count elements backward.
|
| |
| constexpr NonNull | offset (isize count) const noexcept |
| | Calculates the pointer offset by a signed count of elements.
|
| |
| constexpr NonNull | byte_add (usize bytes) const noexcept |
| | Calculates the pointer offset by bytes bytes forward.
|
| |
| constexpr NonNull | byte_sub (usize bytes) const noexcept |
| | Calculates the pointer offset by bytes bytes backward.
|
| |
|
| static constexpr auto | make (pointer_t p) noexcept -> Option< NonNull > |
| | Creates a NonNull if the pointer is non-null, or None otherwise.
|
| |
| static constexpr auto | make_unchecked (pointer_t p) noexcept -> NonNull |
| | Creates a NonNull without checking that the pointer is non-null.
|
| |
|
constexpr auto | as_ptr () const noexcept -> const_pointer_t |
| | Returns the inner pointer as a const pointer.
|
| |
|
constexpr auto | as_mut_ptr () const noexcept -> pointer_t |
| | Returns the inner pointer as a mutable pointer.
|
| |
|
constexpr | operator bool () const noexcept |
| | Returns true if the pointer is non-null.
|
| |
|
constexpr auto | as_ref () const noexcept |
| | Dereferences the pointer, returning an immutable reference.
|
| |
|
constexpr auto | as_mut () const noexcept |
| | Dereferences the pointer, returning a mutable reference.
|
| |
|
constexpr auto | as_raw_ptr () const noexcept |
| | Returns the underlying raw pointer.
|
| |
template<typename T>
struct rstd::ptr_::non_null::NonNull< T >
A non-null pointer type, analogous to Rust's NonNull<T>.
A non-null pointer type, guaranteed to never be null.
- Template Parameters
-