foundation tier

foundation-sequence

Gapless sequential ID generation with human-readable formatting

Gapless sequential ID generation with human-readable formatting

Tierfoundation
Roleunclassified (baselined)
Pathcrates/foundation/sequence
Edition2021
Targetsfoundation_sequence
Public items0 across 0 modules
Tests36

What it is for

# foundation-sequence

Gapless sequential ID generation with human-readable formatting.

Overview

This crate provides:

Example

use foundation_sequence::{Sequence, SequenceFormat, TemporalSequence, ResetPeriod};

// Basic sequence
let mut seq = Sequence::new("invoices");
assert_eq!(seq.next(), 1);
assert_eq!(seq.next(), 2);

// With formatting
let fmt = SequenceFormat::new("{prefix}-{value:05}").with_prefix("INV");
assert_eq!(fmt.format(42), "INV-00042");

// Temporal sequence (resets yearly)
let mut yearly = TemporalSequence::new("invoices", ResetPeriod::Yearly)
.with_format("{prefix}-{year}-{value:05}")
.with_prefix("INV");
let result = yearly.next();
// Returns: SequenceValue { value: 1, formatted: "INV-2026-00001", ... }

Capabilities

No public items.

How to use it

From this crate's own rustdoc:

use foundation_sequence::{Sequence, SequenceFormat, TemporalSequence, ResetPeriod};

// Basic sequence
let mut seq = Sequence::new("invoices");
assert_eq!(seq.next(), 1);
assert_eq!(seq.next(), 2);

// With formatting
let fmt = SequenceFormat::new("{prefix}-{value:05}").with_prefix("INV");
assert_eq!(fmt.format(42), "INV-00042");

// Temporal sequence (resets yearly)
let mut yearly = TemporalSequence::new("invoices", ResetPeriod::Yearly)
    .with_format("{prefix}-{year}-{value:05}")
    .with_prefix("INV");
let result = yearly.next();
// Returns: SequenceValue { value: 1, formatted: "INV-2026-00001", ... }

Module structure

No public modules: the crate root is its whole surface.

Public surface

No public items.

Re-exports. Exported here, defined elsewhere.

ExportDefined in
Sequencesequence::Sequence
SequenceErrorerror::SequenceError
SequenceFormatformat::SequenceFormat
{ResetPeriod,SequenceValue,TemporalSequence}temporal::{ResetPeriod,SequenceValue,TemporalSequence}

Boundary

Depends on no other workspace tier.

Shares tier foundation with 27 other crates: foundation-audit-log, foundation-basemodels, foundation-bounded-io, foundation-conversation-closure, foundation-crypto-sign, foundation-decisioning, foundation-encounter-vocabulary, foundation-fs-metadata, … (27 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)foundation
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/foundation/sequence
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
thiserror^2noalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio-test^0.4noalways

Build. None.

Depended on by. Nothing in this workspace.

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libfoundation_sequence`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

No workspace crate depends on this one.

Verification

KindCount
Unit tests36
Integration tests0
Examples0
Doctests1

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc00
Public modules with a //! block00

Metrics

MetricValue
Rust source files5
Source lines1035
Code lines640
Public API items0
Public modules0
Tests36
Examples0
Cargo features0
Direct runtime dependencies4
Workspace reverse dependencies0
pie showData
    title Rust source composition
    "Code" : 640
    "Blank or comment" : 395

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All foundation · Manual