Trait ArrayElem

Source
pub trait ArrayElem<'a>: 'a + Sealed {
    type Target;

    // Required method
    unsafe fn from_nonnull(ptr: NonNull<Self::Target>) -> Self;
}
Expand description

Types that can be stored in a RegArray.

⚠️ This trait is sealed and cannot be implemented for types outside of this crate.

Required Associated Types§

Source

type Target

The target type of the pointer stored in the array.

Required Methods§

Source

unsafe fn from_nonnull(ptr: NonNull<Self::Target>) -> Self

Creates a new pointer to Self::Target.

§Safety
  • ptr must point to a valid instance of Self::Target;
  • ptr must be valid for the whole lifetime 'a.

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.

Implementors§

Source§

impl<'a, T: Integer, A: Access> ArrayElem<'a> for Reg<'a, T, A>

Source§

impl<'a, T: ArrayElem<'a>, const N: usize> ArrayElem<'a> for RegArray<'a, T, N>

Source§

type Target = [<T as ArrayElem<'a>>::Target; N]

Source§

impl<'a, T: RegMapPtr<'a>> ArrayElem<'a> for T

Source§

type Target = <T as RegMapPtr<'a>>::RegMap