AlignedBuffer

Struct AlignedBuffer 

pub struct AlignedBuffer<T> { /* private fields */ }

Implementations§

§

impl<T> AlignedBuffer<T>

pub fn new(capacity: usize) -> Result<Self>

pub fn with_alignment(capacity: usize, alignment: usize) -> Result<Self>

pub fn from_slice(data: &[T]) -> Result<Self>
where T: Copy,

pub fn len(&self) -> usize

pub fn is_empty(&self) -> bool

pub fn capacity(&self) -> usize

pub fn as_slice(&self) -> &[T]

pub fn as_ptr(&self) -> *const T

pub fn as_mut_slice(&mut self) -> &mut [T]

pub fn push(&mut self, value: T) -> Result<()>

pub fn extend_from_slice(&mut self, data: &[T]) -> Result<()>
where T: Copy,

pub fn clear(&mut self)

pub fn resize(&mut self, new_len: usize, value: T) -> Result<()>
where T: Copy,

pub fn alignment(&self) -> usize

pub fn is_simd_aligned(&self) -> bool

pub fn to_vec_cloned(&self) -> Vec<T>
where T: Copy,

pub fn to_vec(self) -> Vec<T>
where T: Copy,

pub unsafe fn into_raw_parts(self) -> (*mut T, usize, usize, Layout)

Methods from Deref<Target = [T]>§

1.0.0

pub fn len(&self) -> usize

1.0.0

pub fn is_empty(&self) -> bool

1.0.0

pub fn first(&self) -> Option<&T>

1.0.0

pub fn first_mut(&mut self) -> Option<&mut T>

1.5.0

pub fn split_first(&self) -> Option<(&T, &[T])>

1.5.0

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

1.5.0

pub fn split_last(&self) -> Option<(&T, &[T])>

1.5.0

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

1.0.0

pub fn last(&self) -> Option<&T>

1.0.0

pub fn last_mut(&mut self) -> Option<&mut T>

1.77.0

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

1.77.0

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

1.77.0

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

1.77.0

pub fn split_first_chunk_mut<const N: usize>( &mut self, ) -> Option<(&mut [T; N], &mut [T])>

1.77.0

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>

1.77.0

pub fn split_last_chunk_mut<const N: usize>( &mut self, ) -> Option<(&mut [T], &mut [T; N])>

1.77.0

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

1.77.0

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

1.0.0

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>
where I: SliceIndex<[T]>,

1.0.0

pub fn get_mut<I>( &mut self, index: I, ) -> Option<&mut <I as SliceIndex<[T]>>::Output>
where I: SliceIndex<[T]>,

1.0.0

pub unsafe fn get_unchecked<I>( &self, index: I, ) -> &<I as SliceIndex<[T]>>::Output
where I: SliceIndex<[T]>,

1.0.0

pub unsafe fn get_unchecked_mut<I>( &mut self, index: I, ) -> &mut <I as SliceIndex<[T]>>::Output
where I: SliceIndex<[T]>,

1.0.0

pub fn as_ptr(&self) -> *const T

1.0.0

pub fn as_mut_ptr(&mut self) -> *mut T

1.48.0

pub fn as_ptr_range(&self) -> Range<*const T>

1.48.0

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

1.93.0

pub fn as_array<const N: usize>(&self) -> Option<&[T; N]>

1.93.0

pub fn as_mut_array<const N: usize>(&mut self) -> Option<&mut [T; N]>

1.0.0

pub fn swap(&mut self, a: usize, b: usize)

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)
1.0.0

pub fn reverse(&mut self)

1.0.0

pub fn iter(&self) -> Iter<'_, T>

1.0.0

pub fn iter_mut(&mut self) -> IterMut<'_, T>

1.0.0

pub fn windows(&self, size: usize) -> Windows<'_, T>

1.0.0

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

1.0.0

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

1.31.0

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

1.31.0

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

1.88.0

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

1.88.0

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

1.88.0

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

1.88.0

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( &mut self, ) -> &mut [[T; N]]

1.88.0

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

1.88.0

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

1.94.0

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

1.31.0

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

1.31.0

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

1.31.0

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

1.31.0

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

1.77.0

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where F: FnMut(&T, &T) -> bool,

1.77.0

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where F: FnMut(&T, &T) -> bool,

1.0.0

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

1.0.0

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

1.79.0

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

1.79.0

pub unsafe fn split_at_mut_unchecked( &mut self, mid: usize, ) -> (&mut [T], &mut [T])

1.80.0

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

1.80.0

pub fn split_at_mut_checked( &mut self, mid: usize, ) -> Option<(&mut [T], &mut [T])>

1.0.0

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where F: FnMut(&T) -> bool,

1.0.0

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

1.51.0

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where F: FnMut(&T) -> bool,

1.51.0

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where F: FnMut(&T) -> bool,

1.27.0

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where F: FnMut(&T) -> bool,

1.27.0

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

1.0.0

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where F: FnMut(&T) -> bool,

1.0.0

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

1.0.0

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where F: FnMut(&T) -> bool,

1.0.0

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)
1.0.0

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

1.0.0

pub fn starts_with(&self, needle: &[T]) -> bool
where T: PartialEq,

1.0.0

pub fn ends_with(&self, needle: &[T]) -> bool
where T: PartialEq,

1.51.0

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

1.51.0

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

pub fn strip_circumfix<S, P>(&self, prefix: &P, suffix: &S) -> Option<&[T]>
where T: PartialEq, S: SlicePattern<Item = T> + ?Sized, P: SlicePattern<Item = T> + ?Sized,

🔬This is a nightly-only experimental API. (strip_circumfix)

pub fn trim_prefix<P>(&self, prefix: &P) -> &[T]
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

🔬This is a nightly-only experimental API. (trim_prefix_suffix)

pub fn trim_suffix<P>(&self, suffix: &P) -> &[T]
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

🔬This is a nightly-only experimental API. (trim_prefix_suffix)
1.0.0

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

1.10.0

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, ) -> Result<usize, usize>
where F: FnMut(&'a T) -> B, B: Ord,

1.20.0

pub fn sort_unstable(&mut self)
where T: Ord,

1.20.0

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

1.20.0

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

pub fn partial_sort_unstable<R>(&mut self, range: R)
where T: Ord, R: RangeBounds<usize>,

🔬This is a nightly-only experimental API. (slice_partial_sort_unstable)

pub fn partial_sort_unstable_by<F, R>(&mut self, range: R, compare: F)
where F: FnMut(&T, &T) -> Ordering, R: RangeBounds<usize>,

🔬This is a nightly-only experimental API. (slice_partial_sort_unstable)

pub fn partial_sort_unstable_by_key<K, F, R>(&mut self, range: R, f: F)
where F: FnMut(&T) -> K, K: Ord, R: RangeBounds<usize>,

🔬This is a nightly-only experimental API. (slice_partial_sort_unstable)
1.49.0

pub fn select_nth_unstable( &mut self, index: usize, ) -> (&mut [T], &mut T, &mut [T])
where T: Ord,

1.49.0

pub fn select_nth_unstable_by<F>( &mut self, index: usize, compare: F, ) -> (&mut [T], &mut T, &mut [T])
where F: FnMut(&T, &T) -> Ordering,

1.49.0

pub fn select_nth_unstable_by_key<K, F>( &mut self, index: usize, f: F, ) -> (&mut [T], &mut T, &mut [T])
where F: FnMut(&T) -> K, K: Ord,

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T) -> K, K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)
1.26.0

pub fn rotate_left(&mut self, mid: usize)

1.26.0

pub fn rotate_right(&mut self, k: usize)

1.50.0

pub fn fill(&mut self, value: T)
where T: Clone,

1.51.0

pub fn fill_with<F>(&mut self, f: F)
where F: FnMut() -> T,

1.7.0

pub fn clone_from_slice(&mut self, src: &[T])
where T: Clone,

1.9.0

pub fn copy_from_slice(&mut self, src: &[T])
where T: Copy,

1.37.0

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where R: RangeBounds<usize>, T: Copy,

1.27.0

pub fn swap_with_slice(&mut self, other: &mut [T])

1.30.0

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

1.30.0

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])

🔬This is a nightly-only experimental API. (portable_simd)

pub fn as_simd_mut<const LANES: usize>( &mut self, ) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])

🔬This is a nightly-only experimental API. (portable_simd)
1.82.0

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

1.82.0

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where F: FnMut(&'a T, &'a T) -> bool,

1.82.0

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

1.52.0

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

1.87.0

pub fn split_off<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where R: OneSidedRange<usize>,

1.87.0

pub fn split_off_mut<'a, R>( self: &mut &'a mut [T], range: R, ) -> Option<&'a mut [T]>
where R: OneSidedRange<usize>,

1.87.0

pub fn split_off_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

1.87.0

pub fn split_off_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

1.87.0

pub fn split_off_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

1.87.0

pub fn split_off_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

1.86.0

pub unsafe fn get_disjoint_unchecked_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> [&mut <I as SliceIndex<[T]>>::Output; N]

1.86.0

pub fn get_disjoint_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> Result<[&mut <I as SliceIndex<[T]>>::Output; N], GetDisjointMutError>

1.94.0

pub fn element_offset(&self, element: &T) -> Option<usize>

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

pub fn as_slice(&self) -> &[T]

🔬This is a nightly-only experimental API. (str_as_str)

pub fn as_mut_slice(&mut self) -> &mut [T]

🔬This is a nightly-only experimental API. (str_as_str)
1.0.0

pub fn sort(&mut self)
where T: Ord,

1.0.0

pub fn sort_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

1.7.0

pub fn sort_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

1.34.0

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

1.0.0

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)
1.40.0

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

1.0.0

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

1.3.0

pub fn join<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where [T]: Join<Separator>,

1.0.0

pub fn connect<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where [T]: Join<Separator>,

👎Deprecated since 1.3.0: renamed to join

Trait Implementations§

§

impl<T> Deref for AlignedBuffer<T>

§

type Target = [T]

§

fn deref(&self) -> &Self::Target

§

impl<T> DerefMut for AlignedBuffer<T>

§

fn deref_mut(&mut self) -> &mut Self::Target

§

impl<T> Drop for AlignedBuffer<T>

§

fn drop(&mut self)

Auto Trait Implementations§

§

impl<T> Freeze for AlignedBuffer<T>

§

impl<T> RefUnwindSafe for AlignedBuffer<T>
where T: RefUnwindSafe,

§

impl<T> !Send for AlignedBuffer<T>

§

impl<T> !Sync for AlignedBuffer<T>

§

impl<T> Unpin for AlignedBuffer<T>
where T: Unpin,

§

impl<T> UnwindSafe for AlignedBuffer<T>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

§

impl<T> From<T> for T

§

fn from(t: T) -> T

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

§

impl<T> IntoEither for T

§

fn into_either(self, into_left: bool) -> Either<Self, Self>

§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

§

impl<T> Pointable for T

§

const ALIGN: usize

§

type Init = T

§

unsafe fn init(init: <T as Pointable>::Init) -> usize

§

unsafe fn deref<'a>(ptr: usize) -> &'a T

§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

§

unsafe fn drop(ptr: usize)

§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
§

impl<T> Same for T

§

type Output = T

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

§

fn is_in_subset(&self) -> bool

§

fn to_subset_unchecked(&self) -> SS

§

fn from_subset(element: &SS) -> SP

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,