Struct emf_core_base_rs_ffi::collections::NonNullConst[][src]

#[repr(transparent)]
pub struct NonNullConst<T> where
    T: ?Sized
{ /* fields omitted */ }

A type representing a *const T but non-zero.

Uses NonNull internally, as such, the same restrictions apply.

Implementations

impl<T> NonNullConst<T>[src]

pub const fn dangling() -> NonNullConst<T>[src]

Creates a new NonNullConst that is dangling, but well-aligned.

impl<T> NonNullConst<T> where
    T: ?Sized
[src]

pub const unsafe fn new_unchecked(ptr: *const T) -> NonNullConst<T>[src]

Creates a new NonNull.

Safety

The same restrictions as NonNull::new_unchecked apply.

pub fn new(ptr: *const T) -> Option<NonNullConst<T>>[src]

Creates a new NonNullConst if ptr is non-null.

pub unsafe fn into_mut(&self) -> NonNull<T>[src]

Acquires a mutable version of the pointer.

Safety

It is undefined behavior if the underlying pointer is not already mutable.

pub const fn as_ptr(self) -> *const T[src]

Acquires the underlying *const pointer.

pub unsafe fn as_ref(&self) -> &T[src]

Returns a shared reference to the value.

Safety

The same restrictions as NonNull::as_ref apply.

pub const fn cast<U>(self) -> NonNullConst<U>[src]

Casts to a pointer of another type.

Trait Implementations

impl<T> Clone for NonNullConst<T>[src]

impl<T> Copy for NonNullConst<T>[src]

impl<T> Debug for NonNullConst<T> where
    T: Debug + ?Sized
[src]

impl<T> Eq for NonNullConst<T> where
    T: Eq + ?Sized
[src]

impl<T, const N: usize> From<&'_ [T; N]> for NonNullConst<T> where
    T: Sized
[src]

impl<T> From<&'_ [T]> for NonNullConst<T> where
    T: Sized
[src]

impl<T> From<&'_ T> for NonNullConst<T> where
    T: ?Sized
[src]

impl<T, const N: usize> From<&'_ mut [T; N]> for NonNullConst<T> where
    T: Sized
[src]

impl<T> From<&'_ mut [T]> for NonNullConst<T> where
    T: Sized
[src]

impl<T> From<&'_ mut T> for NonNullConst<T> where
    T: ?Sized
[src]

impl<T> From<NonNull<T>> for NonNullConst<T> where
    T: ?Sized
[src]

impl<T> Ord for NonNullConst<T> where
    T: Ord + ?Sized
[src]

impl<T> PartialEq<NonNullConst<T>> for NonNullConst<T> where
    T: PartialEq + ?Sized
[src]

impl<T> PartialOrd<NonNullConst<T>> for NonNullConst<T> where
    T: PartialOrd + ?Sized
[src]

impl<T> StructuralEq for NonNullConst<T> where
    T: ?Sized
[src]

impl<T> StructuralPartialEq for NonNullConst<T> where
    T: ?Sized
[src]

Auto Trait Implementations

impl<T: ?Sized> RefUnwindSafe for NonNullConst<T> where
    T: RefUnwindSafe

impl<T> !Send for NonNullConst<T>

impl<T> !Sync for NonNullConst<T>

impl<T: ?Sized> Unpin for NonNullConst<T>

impl<T: ?Sized> UnwindSafe for NonNullConst<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.