ByteArray

Trait ByteArray 

Source
pub trait ByteArray:
    ByteArray
    + IndexMut<usize, Output = u8>
    + IndexMut<Range<usize>, Output = [u8]>
    + AsRef<[u8]>
    + AsMut<[u8]> {
    const SIZE: usize;

    // Required method
    fn zeroed() -> Self;
}
Expand description

A helper trait that is implemented only for byte arrays.

It is necessary since associated constants cannot be used in function signatures so far.

Required Associated Constants§

Source

const SIZE: usize

The length of this byte array.

Required Methods§

Source

fn zeroed() -> Self

Return the array with all zeros. Cannot use Default as it is not implemented for all array sizes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<const N: usize> ByteArray for [u8; N]

Source§

const SIZE: usize = N

Source§

fn zeroed() -> Self

Implementors§