pub struct CtlError {
pub code: ErrorCode,
pub message: String,
pub evidence: Option<Value>,
}Expand description
统一错误类型(ADR-004):单一枚举,code() 映射与恢复建议的唯一处。
变体随命令实现扩充;运行路径禁止裸 unwrap/expect。
Fields§
§code: ErrorCode§message: String§evidence: Option<Value>结构化证据(如 AMBIGUOUS 的候选列表,docs/12 §4 协议评审项): agent 可免重取 snapshot 直接裁决。
Implementations§
Trait Implementations§
Source§impl Error for CtlError
impl Error for CtlError
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()
Auto Trait Implementations§
impl Freeze for CtlError
impl RefUnwindSafe for CtlError
impl Send for CtlError
impl Sync for CtlError
impl Unpin for CtlError
impl UnsafeUnpin for CtlError
impl UnwindSafe for CtlError
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