Trait packbytes::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.

Object Safety§

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§