Skip to main content

AsBytes

Trait AsBytes 

Source
pub trait AsBytes {
    // Required method
    fn as_bytes(&self) -> &[u8] ⓘ;
}
Expand description

A trait for types that can be borrowed as a byte slice for radix indexing.

Required Methods§

Source

fn as_bytes(&self) -> &[u8] ⓘ

Returns the key as a contiguous byte slice.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl AsBytes for ByteSlice

Source§

fn as_bytes(&self) -> &[u8] ⓘ

Source§

impl AsBytes for String

Source§

fn as_bytes(&self) -> &[u8] ⓘ

Source§

impl AsBytes for Vec<u8>

Source§

fn as_bytes(&self) -> &[u8] ⓘ

Source§

impl AsBytes for [u8]

Source§

fn as_bytes(&self) -> &[u8] ⓘ

Source§

impl AsBytes for str

Source§

fn as_bytes(&self) -> &[u8] ⓘ

Source§

impl AsBytes for u8

Source§

fn as_bytes(&self) -> &[u8] ⓘ

Source§

impl<T: AsBytes + ?Sized> AsBytes for &T

Source§

fn as_bytes(&self) -> &[u8] ⓘ

Source§

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

Source§

fn as_bytes(&self) -> &[u8] ⓘ

Implementors§