Struct fera_array::PrefixedArray
source · pub struct PrefixedArray<I: PrefixedArrayInfo, T> { /* private fields */ }
Expand description
This is used as starting point to implement other types. See for example the code for RcArray
.
Implementations
sourceimpl<I: PrefixedArrayInfo, T> PrefixedArray<I, T>
impl<I: PrefixedArrayInfo, T> PrefixedArray<I, T>
pub fn allocate(info: I) -> Self
sourcepub unsafe fn write(&mut self, offset: usize, value: T)
pub unsafe fn write(&mut self, offset: usize, value: T)
Write value
to inner data at offset
using std::ptr::write
.
sourcepub fn as_mut_slice(&mut self) -> &mut [T] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [T] ⓘ
Returns the inner data as a mutable slice with length info.len()
.
sourcepub unsafe fn clone_shallow(&self) -> Self
pub unsafe fn clone_shallow(&self) -> Self
Creates a new PrefixedArray
that share the inner data with self
.
sourcepub unsafe fn drop_and_deallocate(&mut self)
pub unsafe fn drop_and_deallocate(&mut self)
Drop the array elements, the info and deallocate.
pub fn info(&self) -> &I
pub fn info_mut(&mut self) -> &mut I
Auto Trait Implementations
impl<I, T> RefUnwindSafe for PrefixedArray<I, T>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<I, T> !Send for PrefixedArray<I, T>
impl<I, T> !Sync for PrefixedArray<I, T>
impl<I, T> Unpin for PrefixedArray<I, T>
impl<I, T> UnwindSafe for PrefixedArray<I, T>where
I: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more