pub struct ObjectIdentity { /* private fields */ }Expand description
An owning, hashable identity key for an FFI object.
The retained strong reference prevents the allocation address from being reused while the key is alive. This makes it suitable for identity-based maps without exposing raw object pointers to downstream code.
Implementations§
Source§impl ObjectIdentity
impl ObjectIdentity
Sourcepub fn of<T: ObjectRefCore>(value: &T) -> Self
pub fn of<T: ObjectRefCore>(value: &T) -> Self
Retain the allocation referenced by value as an identity key.
Trait Implementations§
Source§impl Clone for ObjectIdentity
impl Clone for ObjectIdentity
Source§fn clone(&self) -> ObjectIdentity
fn clone(&self) -> ObjectIdentity
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 moreSource§impl Debug for ObjectIdentity
impl Debug for ObjectIdentity
impl Eq for ObjectIdentity
Source§impl Hash for ObjectIdentity
impl Hash for ObjectIdentity
Source§impl PartialEq for ObjectIdentity
impl PartialEq for ObjectIdentity
Auto Trait Implementations§
impl Freeze for ObjectIdentity
impl RefUnwindSafe for ObjectIdentity
impl Send for ObjectIdentity
impl Sync for ObjectIdentity
impl Unpin for ObjectIdentity
impl UnsafeUnpin for ObjectIdentity
impl UnwindSafe for ObjectIdentity
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