Trait pliantdb_core::schema::view::map::Key[][src]

pub trait Key: Clone + Send + Sync {
    fn as_big_endian_bytes(&self) -> Result<Cow<'_, [u8]>>;
fn from_big_endian_bytes(bytes: &[u8]) -> Result<Self>; }

A trait that enables a type to convert itself to a big-endian/network byte order.

Required methods

fn as_big_endian_bytes(&self) -> Result<Cow<'_, [u8]>>[src]

Convert self into an IVec containing bytes ordered in big-endian/network byte order.

fn from_big_endian_bytes(bytes: &[u8]) -> Result<Self>[src]

Convert a slice of bytes into Self by interpretting bytes in big-endian/network byte order.

Loading content...

Implementations on Foreign Types

impl<'k> Key for Cow<'k, [u8]>[src]

impl Key for Vec<u8>[src]

impl Key for String[src]

impl Key for ()[src]

impl<T> Key for Option<T> where
    T: Key
[src]

fn as_big_endian_bytes(&self) -> Result<Cow<'_, [u8]>>[src]

Panics

Panics if T::into_big_endian_bytes returns an empty IVec.

impl Key for i8[src]

impl Key for u8[src]

impl Key for i16[src]

impl Key for u16[src]

impl Key for i32[src]

impl Key for u32[src]

impl Key for i64[src]

impl Key for u64[src]

impl Key for i128[src]

impl Key for u128[src]

Loading content...

Implementors

Loading content...