Builtin type

std::ptr::NonNull

The methods of NonNull that std::ptr defines, and the instances that mention it.

Methods

method newsource

fn new(p: *T) -> Option[NonNull[T]] { ... }

p as a NonNull, when it is not null.

method new_uncheckedsource

unsafe fn new_unchecked(p: *T) -> NonNull[T] { ... }

p as a NonNull. The C compiler is told it is not null, so a null one is undefined behavior. Caller: p is not null.

method as_ptrsource

fn as_ptr(self) -> *T { ... }

The pointer.