pub enum ModelError {
InvalidTransition {
item_id: String,
from: String,
to: String,
},
ItemNotFound {
item_id: String,
},
CircularContainment {
cycle: Vec<String>,
},
InvalidItemId {
raw: String,
},
AmbiguousId {
prefix: String,
count: usize,
matches: Vec<String>,
},
InvalidEnumValue {
field: String,
value: String,
valid_values: String,
},
DuplicateItem {
item_id: String,
},
CycleDetected {
cycle: Vec<String>,
},
}Expand description
Errors related to domain model violations.
Variants§
InvalidTransition
An invalid state transition was attempted.
Fields
ItemNotFound
The referenced item does not exist.
CircularContainment
Moving the item would create a circular containment chain.
InvalidItemId
The item ID format is invalid.
AmbiguousId
The ID prefix matches multiple items.
Fields
InvalidEnumValue
An enum value (kind, state, urgency, size) is invalid.
Fields
DuplicateItem
A duplicate item was detected.
CycleDetected
A dependency cycle was detected.
Implementations§
Source§impl ModelError
impl ModelError
Sourcepub const fn error_code(&self) -> &'static str
pub const fn error_code(&self) -> &'static str
Machine-readable error code.
Sourcepub fn suggestion(&self) -> String
pub fn suggestion(&self) -> String
Human-readable suggestion.
Trait Implementations§
Source§impl Debug for ModelError
impl Debug for ModelError
Source§impl Display for ModelError
impl Display for ModelError
Source§impl Error for ModelError
impl Error for ModelError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ModelError> for BonesError
impl From<ModelError> for BonesError
Source§fn from(source: ModelError) -> Self
fn from(source: ModelError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ModelError
impl RefUnwindSafe for ModelError
impl Send for ModelError
impl Sync for ModelError
impl Unpin for ModelError
impl UnsafeUnpin for ModelError
impl UnwindSafe for ModelError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more