use-id-prefix 0.0.1

Prefixed identifier primitives for RustUse
Documentation
  • Coverage
  • 21.62%
    8 out of 37 items documented1 out of 22 items with examples
  • Size
  • Source code size: 13.13 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 633.9 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 18s 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-id-prefix

Prefixed identifier parsing and formatting helpers for RustUse.

Install

[dependencies]
use-id-prefix = "0.0.1"

Foundation

use-id-prefix models prefixes such as usr, org, repo, and evt, then composes them with validated identifier bodies using a fixed prefix_value shape.

Example

use use_id_prefix::{PrefixedId, PrefixedIdentifierKind, TypedPrefixedId};

struct User;

impl PrefixedIdentifierKind for User {
    const PREFIX: &'static str = "usr";
}

let parsed = PrefixedId::parse("usr_123")?;
let typed = TypedPrefixedId::<User>::new("123")?;

assert_eq!(parsed.to_string(), "usr_123");
assert_eq!(typed.to_string(), "usr_123");
# Ok::<(), use_id_prefix::IdPrefixError>(())

When to use directly

Choose use-id-prefix when prefix parsing and formatting are the only identifier concern you need.

Scope

  • Prefixes stay lowercase ASCII with optional digits after the first character.
  • Values stay lightweight and string-backed.
  • Registry lookup and storage policies are out of scope.

Status

use-id-prefix is a pre-1.0 crate with a narrow prefixed-ID API.