pub struct CatalogGeneration(/* private fields */);Expand description
Monotonic catalog mutation counter. Every catalog mutation advances the generation so stale activations can be detected and invalidated.
Implementations§
Source§impl CatalogGeneration
impl CatalogGeneration
pub const fn initial() -> Self
Sourcepub const fn new(value: u64) -> Self
pub const fn new(value: u64) -> Self
Construct a generation at an explicit value (boundary tests, resuming persisted counters). Constructing a generation grants nothing.
Sourcepub fn checked_next(self) -> Result<Self, CatalogGenerationOverflow>
pub fn checked_next(self) -> Result<Self, CatalogGenerationOverflow>
Fail-closed advancement: at u64::MAX there is no new generation, so
the caller must abort its mutation instead of wrapping or sticking
(either of which could let stale grants keep validating).
pub const fn value(self) -> u64
Trait Implementations§
Source§impl Clone for CatalogGeneration
impl Clone for CatalogGeneration
Source§fn clone(&self) -> CatalogGeneration
fn clone(&self) -> CatalogGeneration
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 CatalogGeneration
Source§impl Debug for CatalogGeneration
impl Debug for CatalogGeneration
impl Eq for CatalogGeneration
Source§impl Hash for CatalogGeneration
impl Hash for CatalogGeneration
Source§impl Ord for CatalogGeneration
impl Ord for CatalogGeneration
Source§fn cmp(&self, other: &CatalogGeneration) -> Ordering
fn cmp(&self, other: &CatalogGeneration) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CatalogGeneration
impl PartialEq for CatalogGeneration
Source§impl PartialOrd for CatalogGeneration
impl PartialOrd for CatalogGeneration
Source§impl Serialize for CatalogGeneration
impl Serialize for CatalogGeneration
impl StructuralPartialEq for CatalogGeneration
Auto Trait Implementations§
impl Freeze for CatalogGeneration
impl RefUnwindSafe for CatalogGeneration
impl Send for CatalogGeneration
impl Sync for CatalogGeneration
impl Unpin for CatalogGeneration
impl UnsafeUnpin for CatalogGeneration
impl UnwindSafe for CatalogGeneration
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.