use-identifier 0.0.1

Composable string-backed identifier primitives for RustUse
Documentation
  • Coverage
  • 16.67%
    4 out of 24 items documented1 out of 17 items with examples
  • Size
  • Source code size: 9.64 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 546.04 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-id
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-identifier

String-backed and typed identifier primitives for RustUse.

Install

[dependencies]
use-identifier = "0.0.1"

Foundation

use-identifier provides a validated Identifier type plus a lightweight TypedIdentifier<K> wrapper for cases where an identifier should carry domain meaning without changing its storage shape.

Example

use use_identifier::{Identifier, IdentifierKind, TypedIdentifier};

struct Account;

impl IdentifierKind for Account {
    const NAME: &'static str = "account";
}

let plain = Identifier::new("acct_42")?;
let typed = TypedIdentifier::<Account>::new("acct_42")?;

assert_eq!(plain.as_str(), typed.as_str());
assert_eq!(typed.kind_name(), "account");
# Ok::<(), use_identifier::IdentifierError>(())

When to use directly

Choose use-identifier when plain validated identifiers or a typed wrapper are the only ID surface you need.

Scope

  • Identifiers stay string-backed.
  • Validation stays predictable and ASCII-oriented.
  • Registry lookup, persistence, and generation policies are out of scope.

Status

use-identifier is a pre-1.0 crate with a deliberately small API.