pub struct ProtectKey {
slot: u32,
generation: u32,
}Expand description
Generational key for a slot in a ProtectPool.
Contains a slot index and a generation counter. If a slot is released and
reused, the old key’s generation won’t match and operations will safely
return None or no-op.
8 bytes: 4-byte slot index + 4-byte generation.
Fields§
§slot: u32§generation: u32Trait Implementations§
Source§impl Clone for ProtectKey
impl Clone for ProtectKey
Source§fn clone(&self) -> ProtectKey
fn clone(&self) -> ProtectKey
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 ProtectKey
Source§impl Debug for ProtectKey
impl Debug for ProtectKey
Source§impl Eq for ProtectKey
impl Eq for ProtectKey
Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
🔬This is a nightly-only experimental API. (
derive_eq_internals)1.0.0 (const: unstable) · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
👎Deprecated since 1.95.0:
implementation detail of #[derive(Eq)]
Source§impl Hash for ProtectKey
impl Hash for ProtectKey
Source§impl PartialEq for ProtectKey
impl PartialEq for ProtectKey
Source§fn eq(&self, other: &ProtectKey) -> bool
fn eq(&self, other: &ProtectKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProtectKey
impl TrivialClone for ProtectKey
Auto Trait Implementations§
impl Freeze for ProtectKey
impl RefUnwindSafe for ProtectKey
impl Send for ProtectKey
impl Sync for ProtectKey
impl Unpin for ProtectKey
impl UnsafeUnpin for ProtectKey
impl UnwindSafe for ProtectKey
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,
impl<T> Printable for T
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
🔬This is a nightly-only experimental API. (
core_io_internals)Returns a lower bound on the number of elements this container-like item
contains.
For example, an array
[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
🔬This is a nightly-only experimental API. (
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read moreLayout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes