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§
sourcetype ElementAddr
type ElementAddr
The type of the element pointer.
Required Methods§
sourceunsafe fn from_raw_parts(ptr: Self::ElementAddr, len: usize) -> Self::Ref
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 atptr
, in the slice.
Safety
The base address and the element count must describe a valid region of memory.