Module ids

Module ids 

Source
Expand description

String-based identifiers for fonts, templates, and styles.

Each identifier is a validated, non-empty string wrapped in a distinct newtype for compile-time safety. You cannot accidentally pass a FontId where a StyleName is expected.

§Phase 1 Migration

The internal String will migrate to an interned representation (e.g. lasso::Spur or string_cache::Atom) for O(1) equality and memory deduplication. The public API (new, as_str) stays identical.

§Examples

use hwpforge_foundation::FontId;

let font = FontId::new("Batang").unwrap();
assert_eq!(font.as_str(), "Batang");
assert_eq!(font.to_string(), "Batang");

// Empty string is rejected
assert!(FontId::new("").is_err());

Structs§

FontId
A font identifier (e.g. "Batang", "Dotum", "Arial").
StyleName
A style name (e.g. "heading1", "본문", "normal").
TemplateName
A template name (e.g. "gov_proposal", "letter").