Skip to main content

Crate use_id

Crate use_id 

Source
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§

prelude

Structs§

IdPrefix
Identifier
PrefixedId
Slug
StableId
TypedIdentifier
TypedPrefixedId
UlidId
UuidId

Enums§

IdPrefixError
IdentifierError
SlugError
UlidIdError
UuidIdError

Traits§

IdentifierKind
PrefixedIdentifierKind

Functions§

format_prefixed_id
Formats a prefix and value into the canonical prefix_value representation.
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.