Skip to main content

GenerationInt

Trait GenerationInt 

Source
pub trait GenerationInt:
    Copy
    + Eq
    + Sealed {
    const ZERO: Self;

    // Required method
    fn wrapping_inc(self) -> Self;
}
Expand description

Width of the generation counter. Public so callers can pick u32 (default — 2^32 reuses per slot before wraparound) or u64 (effectively unbounded). Internal trait sealed via the empty trait pattern.

Required Associated Constants§

Source

const ZERO: Self

Initial generation value.

Required Methods§

Source

fn wrapping_inc(self) -> Self

Increment, wrapping at the type’s max value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl GenerationInt for u32

Source§

const ZERO: Self = 0

Source§

fn wrapping_inc(self) -> Self

Source§

impl GenerationInt for u64

Source§

const ZERO: Self = 0

Source§

fn wrapping_inc(self) -> Self

Implementors§