Trait fuzzy_rocks::Key

source ·
pub trait Key: Eq + Hash + Clone + KeyUnsafe {
    // Required methods
    fn num_chars(&self) -> usize;
    fn as_bytes(&self) -> &[u8] ;
    fn into_bytes(self) -> Vec<u8>;
    fn borrow_key_chars(&self) -> Option<&[Self::KeyCharT]>;
    fn get_key_chars(&self) -> Vec<Self::KeyCharT>;
    fn borrow_key_str(&self) -> Option<&str>;
    fn get_key_string(&self) -> String;
}
Expand description

Implemented by all types that can be used as keys to access records in a Table, whether they are UTF-8 encoded &str, Strings, or arrays of KeyCharT

Required Methods§

source

fn num_chars(&self) -> usize

source

fn as_bytes(&self) -> &[u8]

source

fn into_bytes(self) -> Vec<u8>

source

fn borrow_key_chars(&self) -> Option<&[Self::KeyCharT]>

source

fn get_key_chars(&self) -> Vec<Self::KeyCharT>

source

fn borrow_key_str(&self) -> Option<&str>

source

fn get_key_string(&self) -> String

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Key for &str

source§

impl Key for String

source§

impl<KeyCharT> Key for &[KeyCharT]
where KeyCharT: 'static + Copy + Eq + Hash + Serialize + DeserializeOwned,

source§

impl<KeyCharT> Key for Vec<KeyCharT>
where KeyCharT: 'static + Copy + Eq + Hash + Serialize + DeserializeOwned,

Implementors§