pub struct DynamicKey { /* private fields */ }Expand description
A Praxis value used as a hash-collection key, paired with its descriptor so
Rust’s HashMap/HashSet can hash and compare it structurally (§11.3).
Two keys are equal iff they carry the same descriptor and that descriptor’s
equals callback reports them structurally equal (§5.5). The GcRef is the
rooted value; the descriptor is the &'static TypeDescriptor the value’s own
header names.
Both fields are private and the descriptor is derived from the value, so
“a key whose descriptor names a different type than its payload” is
unrepresentable: DynamicKey::new is the only way in, and it reads the
descriptor out of the object’s header.
Implementations§
Source§impl DynamicKey
impl DynamicKey
Sourcepub fn descriptor(&self) -> &'static TypeDescriptor
pub fn descriptor(&self) -> &'static TypeDescriptor
The descriptor selecting this key’s hash/equals callbacks. Always the
value’s own descriptor.
Trait Implementations§
Source§impl Clone for DynamicKey
impl Clone for DynamicKey
Source§fn clone(&self) -> DynamicKey
fn clone(&self) -> DynamicKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DynamicKey
Source§impl Debug for DynamicKey
impl Debug for DynamicKey
impl Eq for DynamicKey
Source§impl Hash for DynamicKey
impl Hash for DynamicKey
Auto Trait Implementations§
impl !RefUnwindSafe for DynamicKey
impl !Send for DynamicKey
impl !Sync for DynamicKey
impl !UnwindSafe for DynamicKey
impl Freeze for DynamicKey
impl Unpin for DynamicKey
impl UnsafeUnpin for DynamicKey
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