pub struct KeyData { /* private fields */ }
Expand description
Implementations§
source§impl KeyData
impl KeyData
sourcepub fn as_ffi(self) -> u64
pub fn as_ffi(self) -> u64
Returns the key data as a 64-bit integer. No guarantees about its value
are made other than that passing it to from_ffi
will return a key equal to the original.
With this you can easily pass slot map keys as opaque handles to foreign code. After you get them back you can confidently use them in your slot map without worrying about unsafe behavior as you would with passing and receiving back references or pointers.
This is not a substitute for proper serialization, use serde
for
that. If you are not doing FFI, you almost surely do not need this
function.
Trait Implementations§
source§impl From<KeyData> for DefaultKey
impl From<KeyData> for DefaultKey
source§impl Ord for KeyData
impl Ord for KeyData
source§impl PartialEq for KeyData
impl PartialEq for KeyData
source§impl PartialOrd for KeyData
impl PartialOrd for KeyData
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for KeyData
impl Eq for KeyData
impl StructuralEq for KeyData
impl StructuralPartialEq for KeyData
Auto Trait Implementations§
impl RefUnwindSafe for KeyData
impl Send for KeyData
impl Sync for KeyData
impl Unpin for KeyData
impl UnwindSafe for KeyData
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