ErrorCodeExt

Trait ErrorCodeExt 

Source
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);

Required Methods§

Source

fn code(&self) -> ErrorCode

Returns the numeric error code for this error.

Implementors§