Trait PointerExt

Source
pub trait PointerExt<T> {
    // Required methods
    unsafe fn select(self, target_other: Self, target_predicate: bool) -> Self;
    unsafe fn select_deref(
        self,
        target_other: Self,
        target_predicate: bool,
    ) -> T;
}
Expand description

Extension trait for pointers.

Required Methods§

Source

unsafe fn select(self, target_other: Self, target_predicate: bool) -> Self

Selects between two pointers based on a predicate.

§Safety

Safety constrains are as per core::ptr::read for both inputs.

Source

unsafe fn select_deref(self, target_other: Self, target_predicate: bool) -> T

Selects between two pointers and dereferences the selected pointer.

§Safety

Safety constrains are as per core::ptr::read for both inputs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> PointerExt<T> for *const T
where T: Copy, usize: Linearity,

Source§

unsafe fn select_deref(self, target_other: Self, target_predicate: bool) -> T

Source§

unsafe fn select(self, target_other: Self, target_dependence: bool) -> Self

Source§

impl<T> PointerExt<T> for *mut T

Source§

unsafe fn select_deref(self, target_other: Self, target_predicate: bool) -> T

Source§

unsafe fn select(self, target_other: Self, target_dependence: bool) -> Self

Implementors§