pub trait AsDatabaseBytes {
const FIXED_SIZE: Option<usize> = None;
// Required method
fn as_key_bytes(&self) -> Cow<'_, [u8]>;
// Provided method
fn as_value_bytes(&self) -> Cow<'_, [u8]> { ... }
}Provided Associated Constants§
Sourceconst FIXED_SIZE: Option<usize> = None
const FIXED_SIZE: Option<usize> = None
Determines whether the values are of fixed size.
This will set the DUP_FIXED_SIZE_VALUES for dup tables flag.
Required Methods§
Sourcefn as_key_bytes(&self) -> Cow<'_, [u8]>
fn as_key_bytes(&self) -> Cow<'_, [u8]>
Returns the byte representation to be used in key encoding. In the default implementation, this will also be used for the value bytes.
Provided Methods§
Sourcefn as_value_bytes(&self) -> Cow<'_, [u8]>
fn as_value_bytes(&self) -> Cow<'_, [u8]>
Returns the byte representation to be used in value encoding. This is used if the value needs to be sorted differently in a dup table. DUP values use a lexicographic sort order.
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.