pub struct KernelError { /* private fields */ }Expand description
Bounded safe failure returned by the agent kernel.
Implementations§
Source§impl KernelError
impl KernelError
Sourcepub fn new(code: KernelErrorCode, message: impl Into<String>) -> Self
pub fn new(code: KernelErrorCode, message: impl Into<String>) -> Self
Creates a bounded English technical failure.
Sourcepub fn provider_failure(
code: KernelErrorCode,
message: impl Into<String>,
) -> Self
pub fn provider_failure( code: KernelErrorCode, message: impl Into<String>, ) -> Self
Creates a provider failure whose message was normalized by an adapter.
Sourcepub const fn code(&self) -> KernelErrorCode
pub const fn code(&self) -> KernelErrorCode
Returns the stable machine-readable code.
Sourcepub const fn is_safe_diagnostic(&self) -> bool
pub const fn is_safe_diagnostic(&self) -> bool
Returns whether the message is safe to expose as provider diagnostics.
Trait Implementations§
Source§impl Clone for KernelError
impl Clone for KernelError
Source§impl Debug for KernelError
impl Debug for KernelError
Source§impl Display for KernelError
impl Display for KernelError
impl Eq for KernelError
Source§impl Error for KernelError
impl Error for KernelError
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<ContentValidationError> for KernelError
impl From<ContentValidationError> for KernelError
Source§fn from(error: ContentValidationError) -> Self
fn from(error: ContentValidationError) -> Self
Converts to this type from the input type.
Source§impl From<ExternalContentError> for KernelError
impl From<ExternalContentError> for KernelError
Source§fn from(error: ExternalContentError) -> Self
fn from(error: ExternalContentError) -> Self
Converts to this type from the input type.
Source§impl From<MessageValidationError> for KernelError
impl From<MessageValidationError> for KernelError
Source§fn from(error: MessageValidationError) -> Self
fn from(error: MessageValidationError) -> Self
Converts to this type from the input type.
Source§impl From<ModelRequestError> for KernelError
impl From<ModelRequestError> for KernelError
Source§fn from(error: ModelRequestError) -> Self
fn from(error: ModelRequestError) -> Self
Converts to this type from the input type.
Source§impl From<SessionStoreError> for KernelError
impl From<SessionStoreError> for KernelError
Source§fn from(error: SessionStoreError) -> Self
fn from(error: SessionStoreError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for KernelError
impl PartialEq for KernelError
impl StructuralPartialEq for KernelError
Auto Trait Implementations§
impl Freeze for KernelError
impl RefUnwindSafe for KernelError
impl Send for KernelError
impl Sync for KernelError
impl Unpin for KernelError
impl UnsafeUnpin for KernelError
impl UnwindSafe for KernelError
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