Trait KeyInit
pub trait KeyInit: KeySizeUser + Sized
Types which can be initialized from a key.
Required Methods
fn new(key: &Key<Self>) -> SelfCreate new value from fixed size key.
Provided Methods
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>Create new value from variable size key.
Errors
Returns
InvalidLengthin the event the length of the provided slice is not equal to<Self as KeySizeUser>::KeySize::USIZE.