pub enum GlobalError {
Agent(AgentError),
LLM(String),
Plugin(String),
Runtime(String),
Io(Error),
Serialization(Error),
Other(String),
}Expand description
全局错误类型
整合所有层的错误类型,提供单一的错误抽象。
Variants§
Agent(AgentError)
Agent 层错误
LLM(String)
LLM 层错误
Plugin(String)
插件错误
Runtime(String)
运行时错误
Io(Error)
IO 错误
Serialization(Error)
序列化错误
Other(String)
其他错误
Implementations§
Source§impl GlobalError
impl GlobalError
Sourcepub fn llm(msg: impl Into<String>) -> GlobalError
pub fn llm(msg: impl Into<String>) -> GlobalError
创建 LLM 错误
Sourcepub fn plugin(msg: impl Into<String>) -> GlobalError
pub fn plugin(msg: impl Into<String>) -> GlobalError
创建插件错误
Sourcepub fn runtime(msg: impl Into<String>) -> GlobalError
pub fn runtime(msg: impl Into<String>) -> GlobalError
创建运行时错误
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
获取错误分类
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
是否为可重试错误
Trait Implementations§
Source§impl Debug for GlobalError
impl Debug for GlobalError
Source§impl Display for GlobalError
impl Display for GlobalError
Source§impl Error for GlobalError
impl Error for GlobalError
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<&str> for GlobalError
impl From<&str> for GlobalError
Source§fn from(s: &str) -> GlobalError
fn from(s: &str) -> GlobalError
Converts to this type from the input type.
Source§impl From<AgentError> for GlobalError
impl From<AgentError> for GlobalError
Source§fn from(source: AgentError) -> GlobalError
fn from(source: AgentError) -> GlobalError
Converts to this type from the input type.
Source§impl From<Error> for GlobalError
impl From<Error> for GlobalError
Source§fn from(source: Error) -> GlobalError
fn from(source: Error) -> GlobalError
Converts to this type from the input type.
Source§impl From<Error> for GlobalError
impl From<Error> for GlobalError
Source§fn from(source: Error) -> GlobalError
fn from(source: Error) -> GlobalError
Converts to this type from the input type.
Source§impl From<Error> for GlobalError
impl From<Error> for GlobalError
Source§fn from(err: Error) -> GlobalError
fn from(err: Error) -> GlobalError
Converts to this type from the input type.
Source§impl From<String> for GlobalError
impl From<String> for GlobalError
Source§fn from(s: String) -> GlobalError
fn from(s: String) -> GlobalError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for GlobalError
impl !RefUnwindSafe for GlobalError
impl Send for GlobalError
impl Sync for GlobalError
impl Unpin for GlobalError
impl UnsafeUnpin for GlobalError
impl !UnwindSafe for GlobalError
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
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> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage
Source§impl<T> Pointable for T
impl<T> Pointable for T
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.