Expand description
§use-id
Feature-gated facade for the focused RustUse identifier crates.
§Install
[dependencies]
use-id = { version = "0.0.1", default-features = false, features = ["identifier", "slug"] }§Foundation
use-id re-exports the focused crates in this workspace behind opt-in features. It keeps the facade thin: direct root re-exports for common types and functions, plus nested modules that mirror the concrete crate boundaries.
§Example
use use_id::{Identifier, Slug};
let identifier = Identifier::new("acct_42")?;
let slug = Slug::new("RustUse Docs")?;
assert_eq!(identifier.as_str(), "acct_42");
assert_eq!(slug.as_str(), "rustuse-docs");§When to use directly
Choose use-id when you want one dependency and one import surface. Prefer the focused crates directly when you only need one domain such as slugs, prefixed IDs, UUIDs, or ULIDs.
§Scope
- The facade stays close to the focused crate APIs.
- Feature flags map directly to the focused crates in this workspace.
- Broad hashing, registry lookup, and persistence concerns are out of scope.
§Status
use-id is a pre-1.0 crate with a deliberately small facade over focused identifier primitives.
Facade for RustUse identifier primitives.
Re-exports§
pub use use_id_prefix as id_prefix;pub use use_identifier as identifier;pub use use_slug as slug;pub use use_stable_id as stable_id;pub use use_ulid as ulid;pub use use_uuid as uuid;
Modules§
Structs§
Enums§
Traits§
Functions§
- format_
prefixed_ id - Formats a prefix and value into the canonical
prefix_valuerepresentation. - is_ulid
- is_uuid
- is_
valid_ identifier - is_
valid_ prefix - is_
valid_ slug - normalize_
identifier - normalize_
prefix - normalize_
slug - stable_
content_ id - stable_
hash64 - stable_
hex - stable_
name_ id - stable_
path_ id - stable_
reference - validate_
identifier - Validates that an identifier is non-empty and contains only supported ASCII characters.
- validate_
prefix - Validates that a prefix starts with a lowercase ASCII letter and only contains lowercase ASCII letters or digits.
- validate_
slug - Validates that a slug is non-empty, lowercase ASCII, and hyphen-delimited.