wyz::comu

Trait SliceReferential

Source
pub trait SliceReferential<'a>: Referential<'a> + Sealed {
    type ElementAddr;

    // Required method
    unsafe fn from_raw_parts(ptr: Self::ElementAddr, len: usize) -> Self::Ref;
}
Expand description

Allows an Address<M, [T]> to produce an ordinary slice reference.

Required Associated Types§

Source

type ElementAddr

The type of the element pointer.

Required Methods§

Source

unsafe fn from_raw_parts(ptr: Self::ElementAddr, len: usize) -> Self::Ref

Constructs an ordinary slice reference from a base-address and a length.

§Parameters
  • ptr: The address of the base element in the slice.
  • len: The number of elements, beginning at ptr, in the slice.
§Safety

The base address and the element count must describe a valid region of memory.

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, M, T> SliceReferential<'a> for Address<Frozen<M>, [T]>
where M: Mutability, T: 'a,

Source§

impl<'a, T> SliceReferential<'a> for Address<Const, [T]>
where T: 'a,

Source§

impl<'a, T> SliceReferential<'a> for Address<Mut, [T]>
where T: 'a,