pub enum ImError {
Parse(String),
UnsupportedWsAction(String),
DuplicateWsAction(String),
InvalidWsHandlerRegistration {
registered: String,
handler: String,
},
IncompleteWsHandlerRegistry {
expected: usize,
actual: usize,
},
InvalidWsFrame(String),
InvalidSeq {
expected: u64,
got: u64,
},
UnknownChannel(u64),
UnknownCorrelation(u64),
Serialize(String),
}Expand description
IM 业务域错误。
§MIN-2 修复:删除双向 From 套娃
原 ImError::Core(#[from] CoreError) + CoreError::ModuleError{ source: Box<dyn Error> }
形成双向 From 路径(ImError → CoreError → ImError),可产生无限嵌套错误链。
修复:删除 ImError::Core 及其 #[from] 自动实现。
依赖方向应单向:helix-core 不依赖 helix-im,helix-im 的错误不应反持 CoreError。
IM 内部错误通过 CoreError::ModuleError { source: Box<dyn Error> } 向上传播,
但 IM 自身不持有 CoreError(避免循环持有)。
若需要包装外部错误,在 module.rs 的 handle 方法中显式 map_err 到 CoreError。
Variants§
Parse(String)
UnsupportedWsAction(String)
DuplicateWsAction(String)
InvalidWsHandlerRegistration
IncompleteWsHandlerRegistry
InvalidWsFrame(String)
InvalidSeq
UnknownChannel(u64)
UnknownCorrelation(u64)
Serialize(String)
Trait Implementations§
Source§impl Error for ImError
impl Error for ImError
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 ImError
impl RefUnwindSafe for ImError
impl Send for ImError
impl Sync for ImError
impl Unpin for ImError
impl UnsafeUnpin for ImError
impl UnwindSafe for ImError
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