Skip to main content

NewBytes

Trait NewBytes 

Source
pub trait NewBytes: MutBytes {
    // Required method
    fn new_bytes() -> Self;
}
Expand description

Arbitrary-length byte array that can be created and initialized.

Required Methods§

Source

fn new_bytes() -> Self

Returns a new byte array. Fixed-length types (such as StackByteArray, [u8; LENGTH] and HeapByteArray) hold LENGTH zero bytes; resizable types (such as Vec<u8> and HeapBytes) are empty.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl NewBytes for Vec<u8>

Available on crate feature alloc only.
Source§

fn new_bytes() -> Self

Source§

impl<const LENGTH: usize> NewBytes for [u8; LENGTH]

Source§

fn new_bytes() -> Self

Implementors§

Source§

impl NewBytes for HeapBytes

Available on crate feature protected only.
Source§

impl NewBytes for Protected<HeapBytes, ReadWrite, Locked>

Available on crate feature protected only.
Source§

impl<const LENGTH: usize> NewBytes for HeapByteArray<LENGTH>

Available on crate feature protected only.
Source§

impl<const LENGTH: usize> NewBytes for Protected<HeapByteArray<LENGTH>, ReadWrite, Locked>

Available on crate feature protected only.
Source§

impl<const LENGTH: usize> NewBytes for StackByteArray<LENGTH>