Struct checked_array::Array [−][src]
A wrapper for array types that exposes checked APIs only
Implementations
impl<Wrapped> Array<Wrapped>
[src]
pub const fn new(array: Wrapped) -> Self
[src]
Wraps an array
pub fn into_inner(self) -> Wrapped
[src]
Returns the wrapped array
Trait Implementations
impl<T, Wrapped> ArrayAlloc<T> for Array<Wrapped> where
Wrapped: AsRef<[T]> + AsMut<[T]> + CanAlloc<T>,
[src]
Wrapped: AsRef<[T]> + AsMut<[T]> + CanAlloc<T>,
type Error = Wrapped::Error
An alloc related error
fn alloc_new() -> Result<Self, Self::Error>
[src]
fn alloc_clone<Source>(elements: &Source) -> Result<Self, Self::Error> where
Source: ArrayRef<T>,
T: Clone,
[src]
Source: ArrayRef<T>,
T: Clone,
fn grow_with(
&mut self,
len: usize,
init: impl FnMut() -> T
) -> Result<(), Self::Error>
[src]
&mut self,
len: usize,
init: impl FnMut() -> T
) -> Result<(), Self::Error>
fn grow(&mut self, len: usize) -> Result<(), Self::Error> where
T: Default,
[src]
T: Default,
fn shrink(&mut self, len: usize) -> Result<(), Self::Error>
[src]
fn push_front(&mut self, element: T) -> Result<(), Self::Error>
[src]
fn push_n_front<Source>(&mut self, elements: &Source) -> Result<(), Self::Error> where
Source: ArrayRef<T>,
T: Clone,
[src]
Source: ArrayRef<T>,
T: Clone,
fn push_back(&mut self, element: T) -> Result<(), Self::Error>
[src]
fn push_n_back<Source>(&mut self, elements: &Source) -> Result<(), Self::Error> where
Source: ArrayRef<T>,
T: Clone,
[src]
Source: ArrayRef<T>,
T: Clone,
fn pop_front(&mut self) -> Result<Option<T>, Self::Error>
[src]
fn pop_n_front(&mut self, len: usize) -> Result<Option<Self>, Self::Error>
[src]
fn pop_back(&mut self) -> Result<Option<T>, Self::Error>
[src]
fn pop_n_back(&mut self, len: usize) -> Result<Option<Self>, Self::Error>
[src]
impl<T, Wrapped> ArrayMut<T> for Array<Wrapped> where
Wrapped: AsRef<[T]> + AsMut<[T]>,
[src]
Wrapped: AsRef<[T]> + AsMut<[T]>,
fn as_slice_mut(&mut self) -> &mut [T]ⓘ
[src]
fn get_mut(&mut self, index: usize) -> Option<&mut T>
[src]
fn get_n_mut<Range>(&mut self, range: Range) -> Option<Array<&mut [T]>> where
Range: RangeBounds<usize>,
[src]
Range: RangeBounds<usize>,
fn first_mut(&mut self) -> Option<&mut T>
[src]
fn last_mut(&mut self) -> Option<&mut T>
[src]
fn iter_mut(&mut self) -> SliceIterMut<'_, T>ⓘ
[src]
fn rotate_left(&mut self, count: usize)
[src]
fn rotate_right(&mut self, count: usize)
[src]
fn reverse(&mut self)
[src]
impl<T, Wrapped> ArrayRef<T> for Array<Wrapped> where
Wrapped: AsRef<[T]>,
[src]
Wrapped: AsRef<[T]>,
fn as_slice(&self) -> &[T]ⓘ
[src]
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
fn get(&self, index: usize) -> Option<&T>
[src]
fn get_n<Range>(&self, range: Range) -> Option<Array<&[T]>> where
Range: RangeBounds<usize>,
[src]
Range: RangeBounds<usize>,
fn first(&self) -> Option<&T>
[src]
fn last(&self) -> Option<&T>
[src]
fn iter(&self) -> SliceIter<'_, T>ⓘ
[src]
fn clone_to<Source>(&self, dest: &mut Source) -> Result<(), BufferTooSmall> where
Source: ArrayMut<T>,
T: Clone,
[src]
Source: ArrayMut<T>,
T: Clone,
impl<Wrapped> AsRef<Array<Wrapped>> for Array<Wrapped>
[src]
impl<Wrapped> Clone for Array<Wrapped> where
Wrapped: Clone,
[src]
Wrapped: Clone,
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Wrapped> Copy for Array<Wrapped> where
Wrapped: Copy,
[src]
Wrapped: Copy,
impl<Wrapped> Debug for Array<Wrapped> where
Wrapped: Debug,
[src]
Wrapped: Debug,
impl<Wrapped> Default for Array<Wrapped> where
Wrapped: Default,
[src]
Wrapped: Default,
impl<Wrapped> Eq for Array<Wrapped> where
Wrapped: Eq,
[src]
Wrapped: Eq,
impl<Wrapped> Hash for Array<Wrapped> where
Wrapped: Hash,
[src]
Wrapped: Hash,
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<Wrapped> IntoIterator for Array<Wrapped> where
Wrapped: IntoIterator,
[src]
Wrapped: IntoIterator,
type Item = Wrapped::Item
The type of the elements being iterated over.
type IntoIter = Wrapped::IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<Wrapped> Ord for Array<Wrapped> where
Wrapped: Ord,
[src]
Wrapped: Ord,
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<Wrapped> PartialEq<Array<Wrapped>> for Array<Wrapped> where
Wrapped: PartialEq,
[src]
Wrapped: PartialEq,
impl<Wrapped> PartialOrd<Array<Wrapped>> for Array<Wrapped> where
Wrapped: PartialOrd,
[src]
Wrapped: PartialOrd,
Auto Trait Implementations
impl<Wrapped> RefUnwindSafe for Array<Wrapped> where
Wrapped: RefUnwindSafe,
Wrapped: RefUnwindSafe,
impl<Wrapped> Send for Array<Wrapped> where
Wrapped: Send,
Wrapped: Send,
impl<Wrapped> Sync for Array<Wrapped> where
Wrapped: Sync,
Wrapped: Sync,
impl<Wrapped> Unpin for Array<Wrapped> where
Wrapped: Unpin,
Wrapped: Unpin,
impl<Wrapped> UnwindSafe for Array<Wrapped> where
Wrapped: UnwindSafe,
Wrapped: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,