pub struct ModuleError {
pub code: ErrorCode,
pub message: String,
pub details: HashMap<String, Value>,
pub cause: Option<String>,
pub trace_id: Option<String>,
pub timestamp: DateTime<Utc>,
pub retryable: Option<bool>,
pub ai_guidance: Option<String>,
pub user_fixable: Option<bool>,
pub suggestion: Option<String>,
}Expand description
Structured error returned by module execution.
Fields§
§code: ErrorCode§message: String§details: HashMap<String, Value>§cause: Option<String>§trace_id: Option<String>§timestamp: DateTime<Utc>§retryable: Option<bool>§ai_guidance: Option<String>§user_fixable: Option<bool>§suggestion: Option<String>Implementations§
Source§impl ModuleError
impl ModuleError
pub fn new(code: ErrorCode, message: impl Into<String>) -> ModuleError
pub fn with_details(self, details: HashMap<String, Value>) -> ModuleError
pub fn with_cause(self, cause: impl Into<String>) -> ModuleError
pub fn with_trace_id(self, trace_id: impl Into<String>) -> ModuleError
pub fn with_ai_guidance(self, ai_guidance: impl Into<String>) -> ModuleError
pub fn with_retryable(self, retryable: bool) -> ModuleError
pub fn with_suggestion(self, suggestion: impl Into<String>) -> ModuleError
Trait Implementations§
Source§impl Clone for ModuleError
impl Clone for ModuleError
Source§fn clone(&self) -> ModuleError
fn clone(&self) -> ModuleError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModuleError
impl Debug for ModuleError
Source§impl<'de> Deserialize<'de> for ModuleError
impl<'de> Deserialize<'de> for ModuleError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModuleError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModuleError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ModuleError
impl Display for ModuleError
Source§impl Error for ModuleError
impl Error for ModuleError
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<Error> for ModuleError
impl From<Error> for ModuleError
Source§fn from(err: Error) -> ModuleError
fn from(err: Error) -> ModuleError
Converts to this type from the input type.
Source§impl From<ModuleError> for AxumApcoreError
impl From<ModuleError> for AxumApcoreError
Source§fn from(source: ModuleError) -> Self
fn from(source: ModuleError) -> Self
Converts to this type from the input type.
Source§impl Serialize for ModuleError
impl Serialize for ModuleError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ModuleError
impl RefUnwindSafe for ModuleError
impl Send for ModuleError
impl Sync for ModuleError
impl Unpin for ModuleError
impl UnsafeUnpin for ModuleError
impl UnwindSafe for ModuleError
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