pub struct ArrayPtr<T>(/* private fields */);Expand description
A dynamically allocated array of T
Implementations§
Source§impl<T> ArrayPtr<T>
impl<T> ArrayPtr<T>
Sourcepub fn new_uninit(count: usize) -> ArrayPtr<MaybeUninit<T>>
pub fn new_uninit(count: usize) -> ArrayPtr<MaybeUninit<T>>
Allocate a new ArrayPtr<T> without initializing the memory
The number of elements is given by the input parameter count
pub fn shift_once(&mut self)where
T: Copy,
Source§impl<T> ArrayPtr<MaybeUninit<T>>
impl<T> ArrayPtr<MaybeUninit<T>>
Sourcepub unsafe fn assume_init(self) -> ArrayPtr<T>
pub unsafe fn assume_init(self) -> ArrayPtr<T>
Source§impl<T> ArrayPtr<T>
impl<T> ArrayPtr<T>
Sourcepub fn from_fn(count: usize, idx_map: impl Fn(usize) -> T) -> ArrayPtr<T>
pub fn from_fn(count: usize, idx_map: impl Fn(usize) -> T) -> ArrayPtr<T>
Create a new ArrayPtr<T> from a provided closure and element-count
The closure will be invoked as an index-mapping from 0 up to the specified element-count.
Sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice-reference to the underlying data
Trait Implementations§
Source§impl<T> From<ArrayPtr<T>> for CircularBuffer<T>
impl<T> From<ArrayPtr<T>> for CircularBuffer<T>
Source§impl<T> FromIterator<T> for ArrayPtr<T>
impl<T> FromIterator<T> for ArrayPtr<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<T> Freeze for ArrayPtr<T>
impl<T> RefUnwindSafe for ArrayPtr<T>where
T: RefUnwindSafe,
impl<T> !Send for ArrayPtr<T>
impl<T> !Sync for ArrayPtr<T>
impl<T> Unpin for ArrayPtr<T>
impl<T> UnwindSafe for ArrayPtr<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more