#[non_exhaustive]pub struct TxCompilerError {
pub code: TxCompilerErrorCode,
pub message: String,
pub details: Option<Value>,
}Expand description
Structured error returned by every public operation.
The error carries a machine-readable TxCompilerErrorCode, a
human-readable message, and an optional JSON object with debug context.
Only TxCompilerError::code is part of the stable API: downstream
code should match on code for branching logic. The message text
is human-readable and MAY change between versions for clarity.
details is an unstable debug payload — do not pattern-match on
its keys.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.code: TxCompilerErrorCodeMachine-readable error discriminator.
message: StringHuman-readable description of the failure. Not part of the stable API — do not pattern-match on contents.
details: Option<Value>Optional structured context useful for debugging. Unstable; do not pattern-match on keys.
Implementations§
Source§impl TxCompilerError
impl TxCompilerError
Sourcepub fn new(code: TxCompilerErrorCode, message: impl Into<String>) -> Self
pub fn new(code: TxCompilerErrorCode, message: impl Into<String>) -> Self
Build an error without a details payload.
Sourcepub fn with_details(
code: TxCompilerErrorCode,
message: impl Into<String>,
details: Value,
) -> Self
pub fn with_details( code: TxCompilerErrorCode, message: impl Into<String>, details: Value, ) -> Self
Build an error with a structured details payload.
Trait Implementations§
Source§impl Clone for TxCompilerError
impl Clone for TxCompilerError
Source§fn clone(&self) -> TxCompilerError
fn clone(&self) -> TxCompilerError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TxCompilerError
impl Debug for TxCompilerError
Source§impl<'de> Deserialize<'de> for TxCompilerError
impl<'de> Deserialize<'de> for TxCompilerError
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>,
Source§impl Display for TxCompilerError
impl Display for TxCompilerError
Source§impl Error for TxCompilerError
impl Error for TxCompilerError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for TxCompilerError
impl RefUnwindSafe for TxCompilerError
impl Send for TxCompilerError
impl Sync for TxCompilerError
impl Unpin for TxCompilerError
impl UnsafeUnpin for TxCompilerError
impl UnwindSafe for TxCompilerError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 more