pub enum McpClientError {
NotConnected,
ConnectionFailed(String),
ConnectionError(String),
ToolCallFailed(String),
InvalidState(String),
ProcessError(String),
TimeoutError(String),
ProtocolError(String),
ToolError(String),
ConfigError(String),
InternalError(String),
}Expand description
MCP客户端错误 / MCP client error
Variants§
NotConnected
未连接到服务器 / Not connected
ConnectionFailed(String)
连接失败 / Connection failed
ConnectionError(String)
连接错误 / Connection error
ToolCallFailed(String)
工具调用失败 / Tool call failed
InvalidState(String)
无效状态 / Invalid state
ProcessError(String)
进程错误 / Process error
TimeoutError(String)
超时错误 / Timeout error
ProtocolError(String)
协议错误 / Protocol error
ToolError(String)
工具错误 / Tool error
ConfigError(String)
配置错误 / Config error
InternalError(String)
内部错误 / Internal error
Implementations§
Source§impl McpClientError
impl McpClientError
Sourcepub fn error_code(&self) -> i32
pub fn error_code(&self) -> i32
获取错误码 / Get error code
Trait Implementations§
Source§impl Debug for McpClientError
impl Debug for McpClientError
Source§impl Display for McpClientError
impl Display for McpClientError
Source§impl Error for McpClientError
impl Error for McpClientError
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<McpClientError> for ComputerError
impl From<McpClientError> for ComputerError
Source§fn from(source: McpClientError) -> Self
fn from(source: McpClientError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for McpClientError
impl RefUnwindSafe for McpClientError
impl Send for McpClientError
impl Sync for McpClientError
impl Unpin for McpClientError
impl UnsafeUnpin for McpClientError
impl UnwindSafe for McpClientError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
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<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
Source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.