Trait possibly_uninit::zeroed::PtrCount [−][src]
Trait unifying T
and [T]
This trait is used to make writing zeroes easier.
Safety
The trait is unsafe
because returning invalid values from ptr_coun*
methods is udefined behavior.
Associated Types
Loading content...Required methods
fn ptr_count(&self) -> (*const Self::Item, usize)
[src]
Returns a pointer pointing to the first item and the count of items.
This is only defined for sized types, in which case it must return
pointer to the value and count 1
and for slices, when it must return
pointer to the zeroth item of the slice and length of the slice.
It’s undefined for trait objects so, the trait is sealed.
fn ptr_count_mut(&mut self) -> (*mut Self::Item, usize)
[src]
Returns a mutable pointer pointing to the first item and the count of items.
This is only defined for sized types, in which case it must return
pointer to the value and count 1
and for slices, when it must return
pointer to the zeroth item of the slice and length of the slice.
It’s undefined for trait objects so, the trait is sealed.
Provided methods
fn as_slice(&self) -> &[Self::Item]
[src]
Helper that turns the value into slice based on ptr
and count
fn as_slice_mut(&mut self) -> &mut [Self::Item] where
Self: AnyValid,
[src]
Self: AnyValid,
Helper that turns the value into mutable slice based on ptr
and count