pub struct Array<T, const LEN: usize>(_);
Expand description
Wrapper type for all fixed arrays implementing many important traits, so types based on it can simply derive their implementations.
Type keeps data in little-endian byte order and displays them in the same order (like bitcoin SHA256 single hash type).
Implementations
sourceimpl<T, const LEN: usize> Array<T, LEN>
impl<T, const LEN: usize> Array<T, LEN>
sourcepub fn as_slice_mut(&mut self) -> &mut [T] ⓘ
pub fn as_slice_mut(&mut self) -> &mut [T] ⓘ
Returns mutable byte slice representation.
Trait Implementations
sourceimpl<T, const LEN: usize> BorrowMut<[T]> for Array<T, LEN>
impl<T, const LEN: usize> BorrowMut<[T]> for Array<T, LEN>
sourcefn borrow_mut(&mut self) -> &mut [T] ⓘ
fn borrow_mut(&mut self) -> &mut [T] ⓘ
Mutably borrows from an owned value. Read more
sourceimpl<const LEN: usize> FromHex for Array<u8, LEN>
impl<const LEN: usize> FromHex for Array<u8, LEN>
sourcefn from_byte_iter<I>(iter: I) -> Result<Self, Error>where
I: Iterator<Item = Result<u8, Error>> + ExactSizeIterator + DoubleEndedIterator,
fn from_byte_iter<I>(iter: I) -> Result<Self, Error>where
I: Iterator<Item = Result<u8, Error>> + ExactSizeIterator + DoubleEndedIterator,
Produce an object from a byte iterator
sourceimpl<T: Ord, const LEN: usize> Ord for Array<T, LEN>
impl<T: Ord, const LEN: usize> Ord for Array<T, LEN>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq, const LEN: usize> PartialEq<Array<T, LEN>> for Array<T, LEN>
impl<T: PartialEq, const LEN: usize> PartialEq<Array<T, LEN>> for Array<T, LEN>
sourceimpl<T: PartialOrd, const LEN: usize> PartialOrd<Array<T, LEN>> for Array<T, LEN>
impl<T: PartialOrd, const LEN: usize> PartialOrd<Array<T, LEN>> for Array<T, LEN>
sourcefn partial_cmp(&self, other: &Array<T, LEN>) -> Option<Ordering>
fn partial_cmp(&self, other: &Array<T, LEN>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl<T, const LEN: usize> Wrapper for Array<T, LEN>
impl<T, const LEN: usize> Wrapper for Array<T, LEN>
sourcefn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Instantiates wrapper type with the inner data
sourcefn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Returns reference to the inner representation for the wrapper type
sourcefn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Unwraps the wrapper returning the inner type
sourceimpl<T, const LEN: usize> WrapperMut for Array<T, LEN>
impl<T, const LEN: usize> WrapperMut for Array<T, LEN>
sourcefn as_inner_mut(&mut self) -> &mut Self::Inner
fn as_inner_mut(&mut self) -> &mut Self::Inner
Returns a mutable reference to the inner representation for the wrapper
type Read more
impl<T: Copy, const LEN: usize> Copy for Array<T, LEN>
impl<T: Eq, const LEN: usize> Eq for Array<T, LEN>
impl<T, const LEN: usize> StructuralEq for Array<T, LEN>
impl<T, const LEN: usize> StructuralPartialEq for Array<T, LEN>
Auto Trait Implementations
impl<T, const LEN: usize> RefUnwindSafe for Array<T, LEN>where
T: RefUnwindSafe,
impl<T, const LEN: usize> Send for Array<T, LEN>where
T: Send,
impl<T, const LEN: usize> Sync for Array<T, LEN>where
T: Sync,
impl<T, const LEN: usize> Unpin for Array<T, LEN>where
T: Unpin,
impl<T, const LEN: usize> UnwindSafe for Array<T, LEN>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more