pub trait ErrorCodeExt {
// Required method
fn code(&self) -> ErrorCode;
}Expand description
Trait for mapping domain errors to numeric ErrorCode values.
Each crate’s error type implements this to provide a stable, FFI-safe error code.
§Examples
use hwpforge_foundation::{FoundationError, ErrorCodeExt, ErrorCode};
let err = FoundationError::EmptyIdentifier {
item: "FontId".to_string(),
};
assert_eq!(err.code(), ErrorCode::EmptyIdentifier);