pub struct Key(/* private fields */);
Expand description
Key is a dynamically typed wrapper around any type that implements `Any + Eq
- Hash
(note that
Anyimplies
’static). Key acts as a transparent wrapper for these traits, where
Eqand
PartialEq` in particular perform dynamic type checks before determining value equality.
Implementations§
Source§impl Key
impl Key
Sourcepub fn new<T>(value: T) -> Keywhere
T: Keyable + 'static,
pub fn new<T>(value: T) -> Keywhere
T: Keyable + 'static,
This function returns a new key with the given value. The prescribed
trait bound on machinery::Keyable
refers to a hidden trait that is
automatically implemented for types that implement Any + Eq + Hash
.
This trait is hidden because it should not be implemented manually.
Trait Implementations§
impl Eq for Key
Auto Trait Implementations§
impl Freeze for Key
impl !RefUnwindSafe for Key
impl !Send for Key
impl !Sync for Key
impl Unpin for Key
impl !UnwindSafe for Key
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more