pub struct ParallaxError {
pub code: ErrorCode,
pub message: String,
pub source_component: String,
pub operation: String,
pub runtime: Option<RuntimeKind>,
pub context: Vec<(String, String)>,
pub remediations: Vec<Remediation>,
pub diagnostic: Option<String>,
}Expand description
Structured Parallax error.
Fields§
§code: ErrorCodeStable error code.
message: StringHuman-readable message.
source_component: StringComponent that produced the error.
operation: StringOperation being attempted.
runtime: Option<RuntimeKind>Optional runtime involved.
context: Vec<(String, String)>Structured context key/value pairs.
remediations: Vec<Remediation>Suggested remediations.
diagnostic: Option<String>Optional verbose diagnostic (stack, stderr, etc.).
Implementations§
Source§impl ParallaxError
impl ParallaxError
Sourcepub fn with_source(self, source: impl Into<String>) -> Self
pub fn with_source(self, source: impl Into<String>) -> Self
Set source component.
Sourcepub fn with_operation(self, op: impl Into<String>) -> Self
pub fn with_operation(self, op: impl Into<String>) -> Self
Set operation name.
Sourcepub fn with_runtime(self, runtime: RuntimeKind) -> Self
pub fn with_runtime(self, runtime: RuntimeKind) -> Self
Attach runtime.
Sourcepub fn context(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn context(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add context pair.
Sourcepub fn remediate(self, remediation: Remediation) -> Self
pub fn remediate(self, remediation: Remediation) -> Self
Add remediation.
Sourcepub fn with_diagnostic(self, diagnostic: impl Into<String>) -> Self
pub fn with_diagnostic(self, diagnostic: impl Into<String>) -> Self
Attach verbose diagnostic.
Sourcepub fn format_report(&self, verbose: bool) -> String
pub fn format_report(&self, verbose: bool) -> String
Format a concise user-facing report (non-JSON).
Trait Implementations§
Source§impl Clone for ParallaxError
impl Clone for ParallaxError
Source§impl Debug for ParallaxError
impl Debug for ParallaxError
Source§impl<'de> Deserialize<'de> for ParallaxError
impl<'de> Deserialize<'de> for ParallaxError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ParallaxError
impl Display for ParallaxError
Source§impl Error for ParallaxError
impl Error for ParallaxError
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 ParallaxError
impl From<Error> for ParallaxError
Source§impl From<Error> for ParallaxError
impl From<Error> for ParallaxError
Auto Trait Implementations§
impl Freeze for ParallaxError
impl RefUnwindSafe for ParallaxError
impl Send for ParallaxError
impl Sync for ParallaxError
impl Unpin for ParallaxError
impl UnsafeUnpin for ParallaxError
impl UnwindSafe for ParallaxError
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