Struct spinoso_array::TinyArray[][src]

pub struct TinyArray<T: Default>(_);
This is supported on crate feature tiny-array only.

A contiguous growable array type based on TinyVec<[T; INLINE_CAPACITY]> that implements the small vector optimization.

TinyArray is an alternate implementation of Array that implements the small vector optimization. For TinyArrays less then INLINE_CAPACITY elements long, there is no heap allocation.

TinyArray provides a nearly identical API to the one in Array. There are two important differences:

  1. TinyVec<[T; INLINE_CAPACITY]> is used in some places where Vec<T> would have been used.
  2. Trait bounds on some methods are more restrictive and require elements to be Copy.

Similar to Array, TinyArray implements indexing and mutating APIs that make an ideal backend for the Ruby Array core class. In practice, this results in less generic, more single-use APIs. For example, instead of Vec::drain, TinyArray implements shift, shift_n, pop, and pop_n.

Similarly, slicing APIs are more specialized, such as first_n and last_n. Slicing APIs do not return Option, instead preferring to return an empty slice.

Examples

let mut ary = TinyArray::new();
ary.push(1);
ary.push(2);

assert_eq!(ary.len(), 2);
assert_eq!(ary[0], 1);

assert_eq!(ary.pop(), Some(2));
assert_eq!(ary.len(), 1);

ary[0] = 7;
assert_eq!(ary[0], 7);

ary.extend([1, 2, 3].iter().copied());

for x in &ary {
    println!("{}", x);
}
assert_eq!(ary, &[7, 1, 2, 3]);

Implementations

impl<T> TinyArray<T> where
    T: Default
[src]

#[must_use]pub fn new() -> Self[src]

Construct a new, empty TinyArray<T>.

The vector will not allocate until more than INLINE_CAPACITY elements are pushed into it.

Examples

use spinoso_array::{INLINE_CAPACITY, TinyArray};
let ary: TinyArray<i32> = TinyArray::new();
assert!(ary.is_empty());
assert_eq!(ary.capacity(), INLINE_CAPACITY);

#[must_use]pub fn with_capacity(capacity: usize) -> Self[src]

Construct a new, empty TinyArray<T> with the specified capacity.

The vector will be able to hold max(capacity, INLINE_CAPACITY) elements without reallocating. If capacity is less than or equal to INLINE_CAPACITY, the vector will not allocate.

It is important to note that although the returned vector has the capacity specified, the vector will have a zero length.

Examples

let mut ary: TinyArray<i32> = TinyArray::with_capacity(10);
assert_eq!(ary.len(), 0);
assert_eq!(ary.capacity(), 10);

// These are pushes all done without reallocating...
for i in 0..10 {
    ary.push(i);
}

// ...but this may make the vector reallocate
ary.push(11);

#[must_use]pub fn assoc(first: T, second: T) -> Self[src]

Constuct a new two-element TinyArray from the given arguments.

The vector is constructed without a heap allocation.

Examples

use spinoso_array::{INLINE_CAPACITY, TinyArray};
let ary = TinyArray::assoc(0, 100);
assert_eq!(ary.capacity(), INLINE_CAPACITY);
assert_eq!(ary.len(), 2);
assert_eq!(ary[0], 0);
assert_eq!(ary[1], 100);

#[must_use]pub fn iter(&self) -> Iter<'_, T>[src]

Returns an iterator over the slice.

Examples

let ary = TinyArray::from(&[1, 2, 4]);
let mut iterator = ary.iter();

assert_eq!(iterator.next(), Some(&1));
assert_eq!(iterator.next(), Some(&2));
assert_eq!(iterator.next(), Some(&4));
assert_eq!(iterator.next(), None);

#[must_use]pub fn iter_mut(&mut self) -> IterMut<'_, T>[src]

Returns an iterator that allows modifying each value.

Examples

let mut ary = TinyArray::from(&[1, 2, 4]);
for elem in ary.iter_mut() {
    *elem += 2;
}

assert_eq!(ary, &[3, 4, 6]);

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

Extracts a slice containing the entire vector.

Equivalent to &ary[..].

Examples

let ary = TinyArray::from(&[1, 2, 4]);
let four_index = ary.as_slice().binary_search(&4);
assert_eq!(four_index, Ok(2));

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

Extracts a mutable slice containing the entire vector.

Equivalent to &mut ary[..].

Examples

let mut ary = TinyArray::from(&[2, 1, 4]);
ary.as_mut_slice().sort();
assert_eq!(ary, &[1, 2, 4]);

#[must_use]pub fn as_ptr(&self) -> *const T[src]

Returns a raw pointer to the vector’s buffer.

The caller must ensure that the vector outlives the pointer this function returns, or else it will end up pointing to garbage. Modifying the vector may cause its buffer to be reallocated, which would also make any pointers to it invalid.

The caller must also ensure that the memory the pointer (non-transitively) points to is never written to (except inside an UnsafeCell) using this pointer or any pointer derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

Examples

let ary = TinyArray::from(&[1, 2, 4]);
let ary_ptr = ary.as_ptr();

unsafe {
    for i in 0..ary.len() {
        assert_eq!(*ary_ptr.add(i), 1 << i);
    }
}

#[must_use]pub fn as_mut_ptr(&mut self) -> *mut T[src]

Returns an unsafe mutable pointer to the vector’s buffer.

The caller must ensure that the vector outlives the pointer this function returns, or else it will end up pointing to garbage. Modifying the vector may cause its buffer to be reallocated, which would also make any pointers to it invalid.

Examples

This method is primarily used when mutating a Array via a raw pointer passed over FFI.

See the ARY_PTR macro in mruby.

#[must_use]pub fn into_inner(self) -> TinyVec<[T; 8]>[src]

Consume the array and return the inner TinyVec<[T; INLINE_CAPACITY]>.

Examples

use spinoso_array::{INLINE_CAPACITY, TinyArray};
let ary = TinyArray::from(&[1, 2, 4]);
let vec: TinyVec<[i32; INLINE_CAPACITY]> = ary.into_inner();

impl<T> TinyArray<T> where
    T: Clone + Default
[src]

#[must_use]pub fn into_vec(self) -> Vec<T>[src]

Consume the array and return its elements as a Vec<T>.

For TinyArrays with len() > INLINE_CAPACITY, this is a cheap operation that unwraps the spilled Vec from the TinyVec. For shorter arrays, this method will allocate.

Examples

let ary = TinyArray::from(&[1, 2, 4]);
let vec: Vec<i32> = ary.into_vec();

#[must_use]pub fn into_boxed_slice(self) -> Box<[T]>[src]

Converts the vector into Box<[T]>.

This will drop any excess capacity.

Examples

let ary = TinyArray::from(&[1, 2, 4]);
let slice: Box<[i32]> = ary.into_boxed_slice();

impl<T> TinyArray<T> where
    T: Default
[src]

#[must_use]pub fn capacity(&self) -> usize[src]

Returns the number of elements the vector can hold without reallocating.

The minimum capacity of a TinyArray is INLINE_CAPACITY. TinyArrays with capacity less than or equal to INLINE_CAPACITY are not allocated on the heap.

Examples

use spinoso_array::{INLINE_CAPACITY, TinyArray};
let ary: TinyArray<i32> = TinyArray::with_capacity(1);
assert_eq!(ary.capacity(), INLINE_CAPACITY);

let ary: TinyArray<i32> = TinyArray::with_capacity(10);
assert_eq!(ary.capacity(), 10);

pub fn reserve(&mut self, additional: usize)[src]

Reserves capacity for at least additional more elements to be inserted in the given TinyArray<T>. The collection may reserve more space to avoid frequent reallocations. After calling reserve, capacity will be greater than or equal to self.len() + additional. Does nothing if capacity is already sufficient.

Panics

Panics if the new capacity overflows usize.

Examples

let mut ary = TinyArray::from(&[1]);
ary.reserve(10);
assert!(ary.capacity() >= 11);

pub fn shrink_to_fit(&mut self)[src]

Shrinks the capacity of the vector as much as possible.

It will drop down as close as possible to the length but the allocator may still inform the vector that there is space for a few more elements.

Examples

let mut ary = TinyArray::with_capacity(10);
ary.extend([1, 2, 3].iter().copied());
assert_eq!(ary.capacity(), 10);
ary.shrink_to_fit();
assert!(ary.capacity() >= 3);

pub fn clear(&mut self)[src]

Clears the vector, removing all values.

Note that this method has no effect on the allocated capacity of the vector.

Examples

let mut ary = TinyArray::from(&[1, 2, 4]);
let capacity = ary.capacity();
ary.clear();
assert!(ary.is_empty());
assert_eq!(ary.capacity(), capacity);

#[must_use]pub fn len(&self) -> usize[src]

Returns the number of elements in the vector, also referred to as its ‘length’.

Examples

let ary = TinyArray::from(&[1, 2, 4]);
assert_eq!(ary.len(), 3);

#[must_use]pub fn is_empty(&self) -> bool[src]

Returns true if the vector contains no elements.

Examples

use spinoso_array::TinyArray;
let mut ary = TinyArray::new();
assert!(ary.is_empty());
ary.push(1);
assert!(!ary.is_empty());

#[must_use]pub fn get(&self, index: usize) -> Option<&T>[src]

Returns a reference to an element at the index.

Unlike Vec, this method does not support indexing with a range. See the slice method for retrieving a sub-slice from the array.

Examples

let ary = TinyArray::from(&[1, 2, 4]);
assert_eq!(ary.get(1), Some(&2));
assert_eq!(ary.get(3), None);

#[must_use]pub fn delete_at(&mut self, index: usize) -> Option<T>[src]

Deletes the element at the specified index, returning that element, or None if the index is out of range.

Examples

let mut ary = TinyArray::from(&[1, 2, 4]);
assert_eq!(ary.delete_at(1), Some(2));
assert_eq!(ary.delete_at(10), None);

#[must_use]pub fn first(&self) -> Option<&T>[src]

Returns the first element from the vector, or None if the vector is empty.

To retrieve a slice of the first elements in the vector, use first_n.

Examples

let mut ary = TinyArray::new();
assert_eq!(ary.first(), None);
ary.push(1);
assert_eq!(ary.first(), Some(&1));
ary.push(2);
assert_eq!(ary.first(), Some(&1));

#[must_use]pub fn first_n(&self, n: usize) -> &[T][src]

Returns up to n of the first elements from the vector, or &[] if the vector is empty.

To retrieve only the first element in the vector, use first.

Examples

let mut ary = TinyArray::new();
assert_eq!(ary.first_n(0), &[]);
assert_eq!(ary.first_n(4), &[]);

ary.push(1);
ary.push(2);
assert_eq!(ary.first_n(0), &[]);
assert_eq!(ary.first_n(4), &[1, 2]);

ary.concat(&[3, 4, 5, 6, 7, 8, 9, 10]);
assert_eq!(ary.first_n(0), &[]);
assert_eq!(ary.first_n(4), &[1, 2, 3, 4]);

#[must_use]pub fn last(&self) -> Option<&T>[src]

Returns the last element from the vector, or None if the vector is empty.

To retrieve a slice of the last elements in the vector, use last_n.

Examples

let mut ary = TinyArray::new();
assert_eq!(ary.last(), None);
ary.push(1);
assert_eq!(ary.last(), Some(&1));
ary.push(2);
assert_eq!(ary.last(), Some(&2));

#[must_use]pub fn last_n(&self, n: usize) -> &[T][src]

Returns up to n of the last elements from the vector, or &[] if the vector is empty.

To retrieve only the last element in the vector, use last.

Examples

let mut ary = TinyArray::new();
assert_eq!(ary.last_n(0), &[]);
assert_eq!(ary.last_n(4), &[]);

ary.push(1);
ary.push(2);
assert_eq!(ary.last_n(0), &[]);
assert_eq!(ary.last_n(4), &[1, 2]);

ary.concat(&[3, 4, 5, 6, 7, 8, 9, 10]);
assert_eq!(ary.last_n(0), &[]);
assert_eq!(ary.last_n(4), &[7, 8, 9, 10]);

#[must_use]pub fn take_n(&self, n: usize) -> &[T][src]

Returns a slice of the underlying vector that includes only the first n elements.

If n is greater than or equal to the length of the vector, &self[..] is returned.

The inverse of this operation is drop_n.

Examples

let ary = TinyArray::from(&[1, 2, 4, 7, 8, 9]);
assert_eq!(ary.take_n(0), &[]);
assert_eq!(ary.take_n(2), &[1, 2]);
assert_eq!(ary.take_n(10), &[1, 2, 4, 7, 8, 9]);

#[must_use]pub fn drop_n(&self, n: usize) -> &[T][src]

Returns a slice of the underlying vector that excludes the first n elements.

If n is greater than or equal to the length of the vector, &[] is returned.

The inverse of this operation is take_n.

Examples

let ary = TinyArray::from(&[1, 2, 4, 7, 8, 9]);
assert_eq!(ary.drop_n(0), &[1, 2, 4, 7, 8, 9]);
assert_eq!(ary.drop_n(4), &[8, 9]);
assert_eq!(ary.drop_n(10), &[]);

#[must_use]pub fn pop(&mut self) -> Option<T>[src]

Removes the last element from the vector and returns it, or None if the vector is empty.

To pop more than one element from the end of the vector, use pop_n.

Examples

let mut ary = TinyArray::from(&[1, 2, 4]);
assert_eq!(ary.pop(), Some(4));
assert_eq!(ary, &[1, 2]);

#[must_use]pub fn pop_n(&mut self, n: usize) -> Self[src]

Removes the last n elements from the vector.

To pop a single element from the end of the vector, use pop.

Examples

let mut ary = TinyArray::from(&[1, 2, 4, 7, 8, 9]);
assert_eq!(ary.pop_n(0), &[]);
assert_eq!(ary, &[1, 2, 4, 7, 8, 9]);

assert_eq!(ary.pop_n(3), &[7, 8, 9]);
assert_eq!(ary, &[1, 2, 4]);

assert_eq!(ary.pop_n(100), &[1, 2, 4]);
assert!(ary.is_empty());

assert_eq!(ary.pop_n(1), &[]);
assert!(ary.is_empty());

pub fn push(&mut self, elem: T)[src]

Appends an element to the back of the vector.

To push more than one element to the end of the vector, use concat or extend.

Panics

Panics if the number of elements in the vector overflows a usize.

Examples

let mut ary = TinyArray::from(&[1, 2]);
ary.push(3);
assert_eq!(ary, &[1, 2, 3]);

pub fn reverse(&mut self)[src]

Reverses the order of elements of the vector, in place.

Examples

let mut ary = TinyArray::from(&[1, 2, 4]);
ary.reverse();
assert_eq!(ary, &[4, 2, 1]);

#[must_use]pub fn shift(&mut self) -> Option<T>[src]

Removes the first element of the vector and returns it (shifting all other elements down by one). Returns None if the vector is empty.

This operation is also known as “pop front”.

To remove more than one element from the front of the vector, use shift_n.

Examples

let mut ary = TinyArray::from(&[1, 2]);
assert_eq!(ary.shift(), Some(1));
assert_eq!(ary.shift(), Some(2));
assert_eq!(ary.shift(), None);

#[must_use]pub fn shift_n(&mut self, n: usize) -> Self[src]

Removes the first n elements from the vector.

To shift a single element from the front of the vector, use shift.

Examples

let mut ary = TinyArray::from(&[1, 2, 4, 7, 8, 9]);
assert_eq!(ary.shift_n(0), &[]);
assert_eq!(ary, &[1, 2, 4, 7, 8, 9]);

assert_eq!(ary.shift_n(3), &[1, 2, 4]);
assert_eq!(ary, &[7, 8, 9]);

assert_eq!(ary.shift_n(100), &[7, 8, 9]);
assert!(ary.is_empty());

assert_eq!(ary.shift_n(1), &[]);
assert!(ary.is_empty());

pub fn unshift(&mut self, elem: T)[src]

Inserts an element to the front of the vector.

To insert more than one element to the front of the vector, use unshift_n.

This operation is also known as “prepend”.

Panics

Panics if the number of elements in the vector overflows a usize.

Examples

let mut ary = TinyArray::from(&[1, 2]);
ary.unshift(3);
assert_eq!(ary, &[3, 1, 2]);

#[must_use]pub fn slice(&self, start: usize, len: usize) -> &[T][src]

Return a reference to a subslice of the vector.

This function always returns a slice. If the range specified by start and end overlaps the vector (even if only partially), the overlapping slice is returned. If the range does not overlap the vector, an empty slice is returned.

Examples

let empty: TinyArray<i32> = TinyArray::new();
assert_eq!(empty.slice(0, 0), &[]);
assert_eq!(empty.slice(0, 4), &[]);
assert_eq!(empty.slice(2, 4), &[]);

let ary = TinyArray::from(&[1, 2, 3]);
assert_eq!(ary.slice(0, 0), &[]);
assert_eq!(ary.slice(0, 4), &[1, 2, 3]);
assert_eq!(ary.slice(2, 0), &[]);
assert_eq!(ary.slice(2, 4), &[3]);
assert_eq!(ary.slice(10, 100), &[]);

impl<T> TinyArray<T> where
    T: Clone + Default
[src]

#[must_use]pub fn with_len_and_default(len: usize, default: T) -> Self[src]

Construct a new TinyArray<T> with length len and all elements set to default. The TinyArray will have capacity at least len.

Examples

let ary: TinyArray<&str> = TinyArray::with_len_and_default(3, "spinoso");
assert_eq!(ary.len(), 3);
assert!(ary.capacity() >= 3);
assert_eq!(ary, &["spinoso", "spinoso", "spinoso"]);

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

Appends the elements of other to self.

Slice version of extend. This operation is analogous to “push n”.

Examples

let mut ary = TinyArray::from(&[1, 2, 4]);
ary.concat(&[7, 8, 9]);
assert_eq!(ary.len(), 6);

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

Prepends the elements of other to self.

To insert one element to the front of the vector, use unshift.

This operation is also known as “prepend”.

Panics

Panics if the number of elements in the vector overflows a usize.

Examples

let mut ary = TinyArray::from(&[1, 2]);
ary.unshift_n(&[0, 5, 9]);
assert_eq!(ary, &[0, 5, 9, 1, 2]);

impl<T> TinyArray<T> where
    T: Default + Copy
[src]

#[must_use]pub fn repeat(&self, n: usize) -> Option<Self>[src]

Creates a new array by repeating this array n times.

This function will not panic. If the resulting Array’s capacity would overflow, None is returned.

Examples

Basic usage:

let mut ary = TinyArray::from(&[1, 2]);
let repeated_ary = ary.repeat(3)?;
assert_eq!(repeated_ary, &[1, 2, 1, 2, 1, 2]);

None should be returned on overflow:

let mut ary = TinyArray::from(&[1, 2]);
let repeated_ary = ary.repeat(usize::MAX);
assert_eq!(repeated_ary, None);

impl<T> TinyArray<T> where
    T: Default
[src]

pub fn set(&mut self, index: usize, elem: T)[src]

Set element at position index within the vector, extending the vector with T::default() if index is out of bounds.

Examples

let mut ary = TinyArray::from(&[1, 2 ,4]);
ary.set(1, 11);
assert_eq!(ary, &[1, 11, 4]);
ary.set(5, 263);
assert_eq!(ary, &[1, 11, 4, 0, 0, 263]);

pub fn set_with_drain(&mut self, start: usize, drain: usize, elem: T) -> usize[src]

Insert element at position start within the vector and remove the following drain elements. If start is out of bounds, the vector will be extended with T::default().

This method sets a slice of the TinyArray to a single element, including the zero-length slice. It is similar in intent to calling Vec::splice with a one-element iterator.

set_with_drain will only drain up to the end of the vector.

To set a single element without draining, use set.

Examples

let mut ary = TinyArray::from(&[1, 2, 4]);
ary.set_with_drain(1, 0, 10);
assert_eq!(ary, &[1, 10, 2, 4]);
ary.set_with_drain(2, 5, 20);
assert_eq!(ary, &[1, 10, 20]);
ary.set_with_drain(5, 5, 30);
assert_eq!(ary, &[1, 10, 20, 0, 0, 30]);

impl<T> TinyArray<T> where
    T: Default + Clone
[src]

pub fn insert_slice(&mut self, index: usize, values: &[T])[src]

Insert the elements from a slice at a position index in the vector, extending the vector with T::default() if index is out of bounds.

This method is similar to Vec::splice when called with a zero-length range.

Examples

let mut ary = TinyArray::from(&[1, 2, 4]);
ary.insert_slice(1, &[7, 8, 9]);
assert_eq!(ary, &[1, 7, 8, 9, 2, 4]);
ary.insert_slice(8, &[100, 200]);
assert_eq!(ary, &[1, 7, 8, 9, 2, 4, 0, 0, 100, 200]);

pub fn set_slice(&mut self, index: usize, drain: usize, values: &[T]) -> usize[src]

Insert the elements from a slice at a position index in the vector and remove the following drain elements. The vector is extended with T::default() if index is out of bounds.

This method is similar to Vec::splice when called with a nonzero-length range.

When called with drain == 0, this method is equivalent to insert_slice.

If drain >= src.len() or the tail of the vector is replaced, this method is efficient. Otherwise, a temporary buffer is used to move the elements.

Examples

let mut ary = TinyArray::from(&[1, 2, 4]);
ary.set_slice(1, 5, &[7, 8, 9]);
assert_eq!(ary, &[1, 7, 8, 9]);
ary.set_slice(6, 1, &[100, 200]);
assert_eq!(ary, &[1, 7, 8, 9, 0, 0, 100, 200]);
ary.set_slice(4, 2, &[88, 99]);
assert_eq!(ary, &[1, 7, 8, 9, 88, 99, 100, 200]);
ary.set_slice(6, 2, &[1000, 2000, 3000, 4000]);
assert_eq!(ary, &[1, 7, 8, 9, 88, 99, 1000, 2000, 3000, 4000]);

Trait Implementations

impl<T> AsMut<[T]> for TinyArray<T> where
    T: Default
[src]

impl<T> AsMut<TinyVec<[T; 8]>> for TinyArray<T> where
    T: Default
[src]

impl<T> AsRef<[T]> for TinyArray<T> where
    T: Default
[src]

impl<T> AsRef<TinyVec<[T; 8]>> for TinyArray<T> where
    T: Default
[src]

impl<T> Borrow<[T]> for TinyArray<T> where
    T: Default
[src]

impl<T> BorrowMut<[T]> for TinyArray<T> where
    T: Default
[src]

impl<T: Clone + Default> Clone for TinyArray<T>[src]

impl<T: Debug + Default> Debug for TinyArray<T>[src]

impl<T> Default for TinyArray<T> where
    T: Default
[src]

impl<T> Deref for TinyArray<T> where
    T: Default
[src]

type Target = [T]

The resulting type after dereferencing.

impl<T> DerefMut for TinyArray<T> where
    T: Default
[src]

impl<T: Eq + Default> Eq for TinyArray<T>[src]

impl<'a, T> Extend<&'a T> for TinyArray<T> where
    T: 'a + Clone + Default
[src]

impl<T> Extend<T> for TinyArray<T> where
    T: Default
[src]

impl<T> From<&'_ [T; 0]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<&'_ [T; 1]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 10]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 11]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 12]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 13]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 14]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 15]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 16]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 17]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 18]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 19]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 2]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 20]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 21]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 22]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 23]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 24]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 25]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 26]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 27]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 28]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 29]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 3]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 30]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 31]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 32]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 4]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 5]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 6]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 7]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 8]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<&'_ [T; 9]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<'a, T> From<&'a [T]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<'a, T> From<&'a mut [T]> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<[T; 0]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 1]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 10]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 11]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 12]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 13]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 14]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 15]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 16]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 17]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 18]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 19]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 2]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 20]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 21]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 22]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 23]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 24]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 25]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 26]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 27]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 28]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 29]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 3]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 30]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 31]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 32]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 4]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 5]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 6]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 7]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 8]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<[T; 9]> for TinyArray<T> where
    T: Default
[src]

impl<T> From<Array<T>> for TinyArray<T> where
    T: Default
[src]

impl<T> From<Box<[T], Global>> for TinyArray<T> where
    T: Default
[src]

impl<'a, T> From<Cow<'a, [T]>> for TinyArray<T> where
    T: Clone + Default
[src]

impl<T> From<TinyVec<[T; 8]>> for TinyArray<T> where
    T: Default
[src]

impl<T> From<Vec<T, Global>> for TinyArray<T> where
    T: Default
[src]

impl<'a, T> FromIterator<&'a T> for TinyArray<T> where
    T: 'a + Clone + Default
[src]

impl<T> FromIterator<T> for TinyArray<T> where
    T: Default
[src]

impl<T: Hash + Default> Hash for TinyArray<T>[src]

impl<T, I> Index<I> for TinyArray<T> where
    I: SliceIndex<[T]>,
    T: Default
[src]

type Output = I::Output

The returned type after indexing.

impl<T, I> IndexMut<I> for TinyArray<T> where
    I: SliceIndex<[T]>,
    T: Default
[src]

impl<'a, T> IntoIterator for &'a TinyArray<T> where
    T: Default
[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

impl<'a, T> IntoIterator for &'a mut TinyArray<T> where
    T: Default
[src]

type Item = &'a mut T

The type of the elements being iterated over.

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?

impl<T: Ord + Default> Ord for TinyArray<T>[src]

impl<T, U> PartialEq<&'_ [U; 0]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 1]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 10]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 11]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 12]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 13]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 14]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 15]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 16]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 17]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 18]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 19]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 2]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 20]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 21]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 22]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 23]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 24]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 25]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 26]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 27]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 28]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 29]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 3]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 30]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 31]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 32]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 4]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 5]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 6]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 7]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 8]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<&'_ [U; 9]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 0]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 1]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 10]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 11]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 12]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 13]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 14]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 15]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 16]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 17]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 18]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 19]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 2]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 20]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 21]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 22]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 23]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 24]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 25]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 26]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 27]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 28]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 29]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 3]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 30]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 31]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 32]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 4]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 5]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 6]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 7]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 8]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U; 9]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<[U]> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<Array<U>> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T, U> PartialEq<Box<[U], Global>> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T: PartialEq + Default> PartialEq<TinyArray<T>> for TinyArray<T>[src]

impl<T, U> PartialEq<TinyArray<U>> for [T] where
    T: PartialEq<U>,
    U: Default
[src]

impl<T, U> PartialEq<TinyArray<U>> for Array<T> where
    T: PartialEq<U>,
    U: Default
[src]

impl<T, U> PartialEq<TinyVec<[U; 8]>> for TinyArray<T> where
    T: PartialEq<U> + Default,
    U: Default
[src]

impl<T, U> PartialEq<Vec<U, Global>> for TinyArray<T> where
    T: PartialEq<U> + Default
[src]

impl<T: PartialOrd + Default> PartialOrd<TinyArray<T>> for TinyArray<T>[src]

impl<T: Default> StructuralEq for TinyArray<T>[src]

impl<T: Default> StructuralPartialEq for TinyArray<T>[src]

Auto Trait Implementations

impl<T> Send for TinyArray<T> where
    T: Send

impl<T> Sync for TinyArray<T> where
    T: Sync

impl<T> Unpin for TinyArray<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.