Trait wyz::comu::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.

Object Safety§

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,