pub struct Array<T>{ /* private fields */ }
Implementations§
source§impl<T> Array<T>
impl<T> Array<T>
pub fn capacity(&self) -> usize
pub fn extend(&mut self, new_capacity: usize)
pub fn extend_by(&mut self, additional_capacity: usize)
pub fn as_ptr(&self) -> *const T
pub fn as_mut_ptr(&mut self) -> *mut T
pub fn new(capacity: usize) -> Self
pub fn new_default_bytes(capacity: usize, default: u8) -> Self
pub fn new_with_default(capacity: usize, default: T) -> Selfwhere
T: Copy,
pub fn fill(&mut self, value: T)where
T: Copy,
pub fn iter(&self) -> ArrayIterator<'_, T> ⓘ
pub fn iter_mut(&mut self) -> ArrayIteratorMut<'_, T> ⓘ
pub fn iter_range(&self, start: usize, end: usize) -> ArrayIterator<'_, T> ⓘ
pub fn iter_range_mut( &mut self, start: usize, end: usize, ) -> ArrayIteratorMut<'_, T> ⓘ
sourcepub unsafe fn iter_range_mut_unchecked(
&mut self,
start: usize,
end: usize,
) -> ArrayIteratorMut<'static, T> ⓘ
pub unsafe fn iter_range_mut_unchecked( &mut self, start: usize, end: usize, ) -> ArrayIteratorMut<'static, T> ⓘ
Extremely unsafe as it bypasses lifetime checks. Use if you know what you are doing. This is good for cases where you need dynamically retrieve multiple mutable iterators to chunks of non-overlapping data.
sourcepub fn from_slice(slice: &[T]) -> Self
pub fn from_slice(slice: &[T]) -> Self
Copies the contents of the slice into the array.
pub fn as_slice(&self) -> &[T]
pub fn as_mut_slice(&mut self) -> &mut [T]
pub fn split_at(&mut self, index: usize) -> (&[T], &[T])
pub fn split_at_mut(&mut self, index: usize) -> (&mut [T], &mut [T])
pub fn split_into_parts(&self, parts: usize) -> Array<&[T]>
pub fn split_into_parts_mut(&mut self, parts: usize) -> Vec<&mut [T]>
pub unsafe fn index_unchecked(&self, index: usize) -> &T
pub unsafe fn index_unchecked_mut(&mut self, index: usize) -> &mut T
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Array<T>
impl<T> RefUnwindSafe for Array<T>where
T: RefUnwindSafe,
impl<T> !Send for Array<T>
impl<T> !Sync for Array<T>
impl<T> Unpin for Array<T>
impl<T> UnwindSafe for Array<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)