pub struct FFINonNull<T>(/* private fields */)
where
T: ?Sized;Expand description
Represents a non-null raw pointer, similar to core::ptr::NonNull, but it instead doesn’t guarantee that the pointer is valid,
instead IT SHOULD BE valid, additional checks should be performed before using it.
The purpose is for use alongside crate::ffi::option::OptZero.
Implementations§
Source§impl<T> FFINonNull<T>where
T: ?Sized,
impl<T> FFINonNull<T>where
T: ?Sized,
Sourcepub const fn new(ptr: *mut T) -> Option<FFINonNull<T>>
pub const fn new(ptr: *mut T) -> Option<FFINonNull<T>>
Creates a new instance of FFINonNull if the pointer is not null otherwise returns None.
Sourcepub const unsafe fn new_unchecked(ptr: *mut T) -> FFINonNull<T>
pub const unsafe fn new_unchecked(ptr: *mut T) -> FFINonNull<T>
Creates a new instance of FFINonNull without checking if the pointer is null.
§Safety
The caller must ensure that the pointer is not null.
Sourcepub const fn as_ptr(&self) -> *mut T
pub const fn as_ptr(&self) -> *mut T
Returns the raw pointer stored in this FFINonNull instance.
Trait Implementations§
Source§impl<T> Clone for FFINonNull<T>
impl<T> Clone for FFINonNull<T>
Source§fn clone(&self) -> FFINonNull<T>
fn clone(&self) -> FFINonNull<T>
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<T> Debug for FFINonNull<T>
impl<T> Debug for FFINonNull<T>
Source§impl<T> Hash for FFINonNull<T>
impl<T> Hash for FFINonNull<T>
Source§impl<T> NotZeroable for FFINonNull<T>where
T: ?Sized,
impl<T> NotZeroable for FFINonNull<T>where
T: ?Sized,
Source§impl<T> Ord for FFINonNull<T>
impl<T> Ord for FFINonNull<T>
Source§fn cmp(&self, other: &FFINonNull<T>) -> Ordering
fn cmp(&self, other: &FFINonNull<T>) -> 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<T> PartialEq for FFINonNull<T>
impl<T> PartialEq for FFINonNull<T>
Source§impl<T> PartialOrd for FFINonNull<T>where
T: PartialOrd + ?Sized,
impl<T> PartialOrd for FFINonNull<T>where
T: PartialOrd + ?Sized,
impl<T> Copy for FFINonNull<T>
impl<T> Eq for FFINonNull<T>
impl<T> StructuralPartialEq for FFINonNull<T>where
T: ?Sized,
Auto Trait Implementations§
impl<T> Freeze for FFINonNull<T>where
T: ?Sized,
impl<T> RefUnwindSafe for FFINonNull<T>where
T: RefUnwindSafe + ?Sized,
impl<T> !Send for FFINonNull<T>
impl<T> !Sync for FFINonNull<T>
impl<T> Unpin for FFINonNull<T>where
T: ?Sized,
impl<T> UnwindSafe for FFINonNull<T>where
T: RefUnwindSafe + ?Sized,
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