Trait schemadb::schema::KeyCodec [−][src]
pub trait KeyCodec<S: Schema + ?Sized>: Sized + PartialEq + Debug {
fn encode_key(&self) -> Result<Vec<u8>>;
fn decode_key(data: &[u8]) -> Result<Self>;
}Expand description
This trait defines a type that can serve as a Schema::Key.
Required methods
fn encode_key(&self) -> Result<Vec<u8>>
fn encode_key(&self) -> Result<Vec<u8>>
Converts self to bytes to be stored in DB.