Skip to main content

AsBytes

Trait AsBytes 

Source
pub trait AsBytes<'a> {
    // Required method
    fn bytes<const __: u128>(&'a self) -> Bytes<'a, __>;
}
Expand description

Trait to simplify creation of a Bytes object.

Required Methods§

Source

fn bytes<const __: u128>(&'a self) -> Bytes<'a, __>

Create Bytes from object.

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<'a> AsBytes<'a> for [u8]

Source§

fn bytes<const __: u128>(&'a self) -> Bytes<'a, __>

Implementors§