pub trait TryKeyInit: KeySizeUser + Sized {
// Required method
fn new(key: &Key<Self>) -> Result<Self, InvalidKey>;
// Provided method
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidKey> { ... }
}Expand description
Types which can be fallibly initialized from a key.
Required Methods§
Provided Methods§
Sourcefn new_from_slice(key: &[u8]) -> Result<Self, InvalidKey>
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidKey>
Create new value from a variable size key.
§Errors
If the key is considered invalid according to rules specific to the implementing type.
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.