pub trait Key<'k>: Clone + Send + Sync {
    type Error: AnyError;

    const LENGTH: Option<usize>;

    fn as_big_endian_bytes(&'k self) -> Result<Cow<'k, [u8]>, Self::Error>;
fn from_big_endian_bytes(bytes: &'k [u8]) -> Result<Self, Self::Error>; }
Expand description

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

Associated Types

The error type that can be produced by either serialization or deserialization.

Associated Constants

The size of the key, if constant.

Required methods

Convert self into a Cow<[u8]> containing bytes ordered in big-endian/network byte order.

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

Implementations on Foreign Types

Panics

Panics if T::into_big_endian_bytes returns an empty IVec.

Implementors