Trait kv::Key

source ·
pub trait Key<'a>: Sized + AsRef<[u8]> {
    // Required method
    fn from_raw_key(r: &'a Raw) -> Result<Self, Error>;

    // Provided method
    fn to_raw_key(&self) -> Result<Raw, Error> { ... }
}
Expand description

A Key can be used as a key to a database

Required Methods§

source

fn from_raw_key(r: &'a Raw) -> Result<Self, Error>

Convert from Raw

Provided Methods§

source

fn to_raw_key(&self) -> Result<Raw, Error>

Wrapper around AsRef<u8>

Implementations on Foreign Types§

source§

impl<'a> Key<'a> for String

source§

impl<'a> Key<'a> for &'a str

source§

fn from_raw_key(x: &'a Raw) -> Result<Self, Error>

source§

impl<'a> Key<'a> for &'a [u8]

source§

fn from_raw_key(x: &'a Raw) -> Result<&'a [u8], Error>

source§

impl<'a> Key<'a> for Vec<u8>

Implementors§

source§

impl<'a> Key<'a> for Integer

source§

impl<'a> Key<'a> for Raw