pub enum CdpError {
ProtocolError(String),
JsonError(String),
IoError(Error),
ConnectionClosed,
Timeout(String),
TransportError(String),
HandshakeError(String),
}Expand description
通信阶段错误(Transport 使用,具体实现在 TASK-2)。
变体覆盖 Plan MD 与 REQ-BAO-API-002 要求的完整错误码集合:
CdpError::ProtocolError: 协议层(JSON-RPC error / -32601 / 解析失败)CdpError::IoError: 底层 I/O 错误CdpError::ConnectionClosed: Transport 已关闭或对端断开CdpError::Timeout: 命令调用或 recv_event 超时(TimeoutError)CdpError::TransportError: Transport 实现内部错误(TransportError)CdpError::HandshakeError: WebSocket 握手失败
@trace REQ-BAO-API-002 [interface:Transport]
Variants§
ProtocolError(String)
协议层错误(JSON-RPC error object / unknown method 等)。
JsonError(String)
序列化/反序列化失败。
IoError(Error)
I/O 错误。
ConnectionClosed
连接已关闭。
Timeout(String)
调用超时(TimeoutError)。
TransportError(String)
Transport 实现内部错误(TransportError)。携带上下文用于诊断。
HandshakeError(String)
WebSocket 握手失败。
Trait Implementations§
Source§impl Error for CdpError
impl Error for CdpError
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<ConnectError> for CdpError
impl From<ConnectError> for CdpError
Source§fn from(err: ConnectError) -> CdpError
fn from(err: ConnectError) -> CdpError
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for CdpError
impl !UnwindSafe for CdpError
impl Freeze for CdpError
impl Send for CdpError
impl Sync for CdpError
impl Unpin for CdpError
impl UnsafeUnpin for CdpError
Blanket Implementations§
Source§impl<T> AsCtxPtr for Twhere
T: ?Sized,
impl<T> AsCtxPtr for Twhere
T: ?Sized,
Source§fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
self’s address as *mut Self for deferred-task / scopeguard /
ref_guard ctx slots. The closures/trampolines deref it as shared
(&*p) — every method they reach is &self post-R-2, so no write
provenance is required; the *mut spelling is purely to match the
existing DerefOnDrop / HasAutoFlush / RefCount ABI.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert
impl<T> MaybeSendSync for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Send for Twhere
T: ?Sized,
impl<T> Sync for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more