use-diagnostic-code 0.0.1

Stable diagnostic identifier primitives for RustUse
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented1 out of 6 items with examples
  • Size
  • Source code size: 6.78 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 420.87 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-diagnostic
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-diagnostic-code

Stable diagnostic identifier primitives for RustUse.

Foundation

use-diagnostic-code provides DiagnosticCode, a small string-backed identifier for stable diagnostic names such as CONFIG001, VALIDATE_MISSING_FIELD, and DATA.INVALID_SHAPE.

Codes are trimmed at the edges, reject empty values, and preserve internal characters.

Example

use use_diagnostic_code::DiagnosticCode;

let code = DiagnosticCode::new(" VALIDATE_MISSING_FIELD ").unwrap();

assert_eq!(code.as_str(), "VALIDATE_MISSING_FIELD");
assert_eq!(code.to_string(), "VALIDATE_MISSING_FIELD");

Scope

  • Codes are stable string identifiers.
  • The crate does not reserve prefixes or parse domain-specific code systems.
  • Rendering, logging, and error handling are out of scope.

Status

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