schema/error.rs
1//! Schema validation errors.
2
3/// Result type for schema operations.
4pub type SchemaResult<T> = Result<T, SchemaError>;
5
6/// Errors that can occur when building or validating a schema.
7#[derive(Debug, Clone, PartialEq, Eq)]
8pub enum SchemaError {
9 /// Duplicate component ID in a schema.
10 DuplicateComponentId { id: crate::ComponentId },
11
12 /// Duplicate field ID within a component.
13 DuplicateFieldId {
14 component: crate::ComponentId,
15 field: crate::FieldId,
16 },
17
18 /// Invalid bit width for fixed-width integers.
19 InvalidBitWidth { bits: u8 },
20
21 /// Fixed-point scale must be non-zero.
22 InvalidFixedPointScale { scale: u32 },
23
24 /// Fixed-point min/max range is invalid.
25 InvalidFixedPointRange { min_q: i64, max_q: i64 },
26}