[−][src]Struct boxed_slice::BoxedSlice
A boxed slice, with a compile-time constant size.
use boxed_slice::BoxedSlice; let answer_slice: BoxedSlice<u8, 42> = BoxedSlice::new(42); assert_eq!(answer_slice.len(), 42); assert!(answer_slice.iter().all(|num| *num == 42)); let default_slice: BoxedSlice<u8, 128> = BoxedSlice::default(); assert_eq!(default_slice.len(), 128); assert!(default_slice.iter().all(|num| *num == u8::default()));
Implementations
impl<T, const N: usize> BoxedSlice<T, N>
[src]
pub fn new(initial_value: T) -> Self where
T: Copy,
[src]
T: Copy,
Create a new BoxedSlice
, filling it with the
given initial value.
Methods from Deref<Target = Box<[T; N]>>
Trait Implementations
impl<T, const N: usize> AsMut<[T]> for BoxedSlice<T, N>
[src]
impl<T, const N: usize> AsRef<[T]> for BoxedSlice<T, N>
[src]
impl<T, const N: usize> Clone for BoxedSlice<T, N> where
T: Clone,
[src]
T: Clone,
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T, const N: usize> Debug for BoxedSlice<T, N> where
T: Debug,
[src]
T: Debug,
impl<T, const N: usize> Default for BoxedSlice<T, N> where
T: Default + Copy,
[src]
T: Default + Copy,
impl<T, const N: usize> Deref for BoxedSlice<T, N>
[src]
type Target = Box<[T; N]>
The resulting type after dereferencing.
pub fn deref(&self) -> &Self::Target
[src]
impl<T, const N: usize> DerefMut for BoxedSlice<T, N>
[src]
impl<T, const N: usize> Eq for BoxedSlice<T, N> where
T: Eq,
[src]
T: Eq,
impl<T, F, const N: usize> From<F> for BoxedSlice<T, N> where
F: Into<[T; N]>,
[src]
F: Into<[T; N]>,
impl<T, const N: usize> Hash for BoxedSlice<T, N> where
T: Hash,
[src]
T: Hash,
pub 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<T, const N: usize> PartialEq<BoxedSlice<T, N>> for BoxedSlice<T, N> where
T: PartialEq,
[src]
T: PartialEq,
Auto Trait Implementations
impl<T, const N: usize> Send for BoxedSlice<T, N> where
T: Send,
T: Send,
impl<T, const N: usize> Sync for BoxedSlice<T, N> where
T: Sync,
T: Sync,
impl<T, const N: usize> Unpin for BoxedSlice<T, N>
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,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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>,