BytesBuf

Trait BytesBuf 

Source
pub unsafe trait BytesBuf: AsRef<[u8]> + Into<Vec<u8>> { }
Expand description

Byte buffer.

Any type that implements AsRef<[u8]> and Into<Vec<u8>> such that both implementation yields the same bytes.

§Safety

The Into<Vec<u8>> must return the same bytes as AsRef<[u8]>.

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 BytesBuf for String

Source§

impl BytesBuf for Vec<u8>

Implementors§