pub trait Decode:
Sized
+ Send
+ Sync
+ Debug {
// Required method
fn decode(value: &[u8]) -> Result<Self, DatabaseError>;
// Provided method
fn decode_owned(value: Vec<u8>) -> Result<Self, DatabaseError> { ... }
}
Expand description
Trait that will transform the data to be read from the DB.
Required Methods§
Sourcefn decode(value: &[u8]) -> Result<Self, DatabaseError>
fn decode(value: &[u8]) -> Result<Self, DatabaseError>
Decodes data coming from the database.
Provided Methods§
Sourcefn decode_owned(value: Vec<u8>) -> Result<Self, DatabaseError>
fn decode_owned(value: Vec<u8>) -> Result<Self, DatabaseError>
Decodes owned data coming from the database.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.