pub(crate) trait KeyStorage<K>:
Copy
+ Zero
+ Not<Output = Self>
+ TryFrom<K>
+ TryInto<K>where
K: Key,{
// Provided methods
fn from_key(k: K) -> Self { ... }
fn into_key(self) -> K { ... }
}
Expand description
Backing storage for a specific key type
Intended to be smaller than or equal in size to the full Key type.
Provided Methods§
Sourcefn from_key(k: K) -> Self
fn from_key(k: K) -> Self
Fit the indicated key into a KeyStorage
, wrapping if necessary.
It is normal for keys to accumulate additional insignificant bits on the left side as we compute sums.
Sourcefn into_key(self) -> K
fn into_key(self) -> K
Unpack this KeyStorage
back into a Key type, without
changing its value.
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.