Public declaration syntax from forge-rs/crates/forge-health/src/error.rs Original source SHA-256: 42e102e2cf520679ef5000973df61705d4bc60e3106698c2d751989e2d1c7eb4 Function bodies and constant values are omitted. This is not the complete implementation. Source line 37 #[derive(Debug, Error)] pub enum ForgeHealthError { /// An invalid lifecycle state transition was attempted. /// /// The ANVIL lifecycle state machine defines exactly which transitions are /// valid from each state. This error is returned when a transition is /// attempted that violates the state machine rules. /// /// See ANVIL Spec section 13.2 -- Lifecycle State Machine /// for the complete transition table. #[error("invalid lifecycle transition from {from} to {to}: {reason} (see ANVIL Spec section 5.1, Appendix B)")] InvalidTransition { /// The current lifecycle state. from: LifecycleState, /// The target state that was attempted. to: LifecycleState, /// A human-readable explanation of why this transition is invalid. reason: String, }, /// A lifecycle operation was attempted on a state that does not support it. /// /// For example, attempting to resume an agent that is in the Terminated /// state, or performing any operation on a terminal state. #[error("invalid operation on lifecycle state {state}: {reason}")] InvalidState { /// The current lifecycle state where the operation was attempted. state: LifecycleState, /// A human-readable explanation of why this operation is invalid. reason: String, }, /// A health monitoring operation failed. /// /// This covers failures in health check evaluation, threshold configuration, /// or profile update operations. #[error("health monitor error: {reason}")] MonitorError { /// A human-readable explanation of what went wrong. reason: String, }, } Source line 80 pub type ForgeHealthResult = Result;