pub trait HasKey<K>: Version {
type Key;
// Required methods
fn encode(key: &Self::Key) -> Box<[u8]>;
fn decode(bytes: &[u8]) -> Result<Self::Key, PasetoError>;
}Expand description
Declares that this PASETO implementation supports the given key type, as well as how to encode/decode the key.
Required Associated Types§
Required 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.