Skip to main content

Module id_provider

Module id_provider 

Source
Expand description

Identifier source, injected so tests get a deterministic — but still unique — id sequence.

Production wires UuidProvider (Uuid::new_v4().to_string()); tests construct a SequentialIdProvider and pass it to the unit under test.

Each new_id() call yields a fresh, distinct id. Per-entity uniqueness is preserved: a loop minting one id per row keeps producing distinct ids under both the production and the test provider.

Structs§

SequentialIdProvider
Deterministic but unique: "{prefix}-0", "{prefix}-1", … Preserves the per-entity uniqueness invariant while being reproducible across runs.
UuidProvider
Production provider: random v4 UUIDs.

Traits§

IdProvider
Identifier source. Yields a fresh unique id per call.

Type Aliases§

IdRef
Shared handle to an id provider. Held by Clone types that need to share one id source, so they clone the handle, not the implementation.