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<'de> Deserialize<'de> for KeyData
impl<'de> Deserialize<'de> for KeyData
Source§fn deserialize<D>(
deserializer: D,
) -> Result<KeyData, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<KeyData, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<KeyData> for TrafficLightId
impl From<KeyData> for TrafficLightId
Source§impl Ord for KeyData
impl Ord for KeyData
Source§impl PartialOrd for KeyData
impl PartialOrd for KeyData
Source§impl Serialize for KeyData
impl Serialize for KeyData
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for KeyData
impl Eq for KeyData
impl StructuralPartialEq for KeyData
Auto Trait Implementations§
impl Freeze for KeyData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more