[][src]Module pui_core::dynamic

A dynamically created type that is guarnteed to be unique on the given thread or process

Dynamic uses ScalarAllocator and PoolMut to ensure that it holds a unique value. This value is cloned into the DynamicToken and used to verify identity.

Dynamic initially tries to pull a value from PoolMut if that fails, it then allocates a new value from the ScalarAllocator. Unless the backing Scalar is (), then this checks it's identity at runtime. Hence the name, Dynamic.

If the provided pool is (), then no values will be reused, and this allows Dynamic to implement OneShotIdentifier.

Structs

Dynamic

A dynamically created type that is guarnteed to be unique on the given thread and if A::AutoTraits: Send + Sync on the given process.

DynamicToken

A token that is recognized by Dynamic

Global

A global scalar allocator that's backed by a NonZeroU64. This allows Option<DynamicToken<Global>> to be the same size as DynamicToken<Global>

ThreadLocal

A thread-local scalar allocator that's backed by a NonZeroU64 This allows Option<DynamicToken<ThreadLocal>> to be the same size as DynamicToken<ThreadLocal>