pub trait Key<const N: usize>:
Eq
+ PartialEq
+ Copy
+ Clone
+ Hash
+ Deref<Target = InternalKey<N>> {
type Error;
// Required methods
fn as_slice(&self) -> &[u8] ⓘ;
fn try_from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>;
// Provided method
fn to_vec(&self) -> Vec<u8> ⓘ { ... }
}Expand description
This trait is map keys to / from the users key space into a finite key space used internally. This space is the set of all N-byte arrays where N < 2^32
Required Associated Types§
Required Methods§
Sourcefn as_slice(&self) -> &[u8] ⓘ
fn as_slice(&self) -> &[u8] ⓘ
This should map from the internal key space back into the user’s key space
Sourcefn try_from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>
fn try_from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>
This should map from the user’s key space into the internal keyspace
Provided Methods§
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.