pub struct StructError<T: DomainReason> { /* private fields */ }
Expand description
Structured error type containing detailed error information including error source, contextual data, and debugging information.
Implementations§
Source§impl<T: DomainReason> StructError<T>
Auto-generated by derive_getters::Getters
.
impl<T: DomainReason> StructError<T>
Auto-generated by derive_getters::Getters
.
Source§impl<T: DomainReason> StructError<T>
impl<T: DomainReason> StructError<T>
Source§impl<T: DomainReason> StructError<T>
impl<T: DomainReason> StructError<T>
Sourcepub fn with_position(self, position: impl Into<String>) -> Self
pub fn with_position(self, position: impl Into<String>) -> Self
使用示例 self.with_position(location!());
pub fn with_context(self, context: CallContext) -> Self
pub fn with_detail(self, detail: impl Into<String>) -> Self
pub fn err<V>(self) -> Result<V, Self>
pub fn target(&self) -> Option<String>
Trait Implementations§
Source§impl<T: Clone + DomainReason> Clone for StructError<T>
impl<T: Clone + DomainReason> Clone for StructError<T>
Source§fn clone(&self) -> StructError<T>
fn clone(&self) -> StructError<T>
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<R1, R2> ConvStructError<R2> for StructError<R1>
impl<R1, R2> ConvStructError<R2> for StructError<R1>
fn conv(self) -> StructError<R2>
Source§impl<T: Debug + DomainReason> Debug for StructError<T>
impl<T: Debug + DomainReason> Debug for StructError<T>
Source§impl<T: DomainReason> Deref for StructError<T>
impl<T: DomainReason> Deref for StructError<T>
Source§impl<T: Display + DomainReason + ErrorCode> Display for StructError<T>
impl<T: Display + DomainReason + ErrorCode> Display for StructError<T>
Source§impl<T: DomainReason> Error for StructError<T>
impl<T: DomainReason> Error for StructError<T>
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<T: DomainReason + ErrorCode> ErrorCode for StructError<T>
impl<T: DomainReason + ErrorCode> ErrorCode for StructError<T>
fn error_code(&self) -> i32
Source§impl<T: DomainReason> ErrorWith for StructError<T>
impl<T: DomainReason> ErrorWith for StructError<T>
Source§impl<T> From<T> for StructError<T>where
T: DomainReason,
impl<T> From<T> for StructError<T>where
T: DomainReason,
Source§impl<T: PartialEq + DomainReason> PartialEq for StructError<T>
impl<T: PartialEq + DomainReason> PartialEq for StructError<T>
Source§impl<T: DomainReason> Serialize for StructError<T>
impl<T: DomainReason> Serialize for StructError<T>
Source§impl<T: DomainReason> StructErrorTrait<T> for StructError<T>
impl<T: DomainReason> StructErrorTrait<T> for StructError<T>
fn get_reason(&self) -> &T
fn get_detail(&self) -> Option<&String>
fn get_target(&self) -> Option<String>
impl<T: DomainReason> StructuralPartialEq for StructError<T>
Auto Trait Implementations§
impl<T> Freeze for StructError<T>
impl<T> RefUnwindSafe for StructError<T>where
T: RefUnwindSafe,
impl<T> Send for StructError<T>where
T: Send,
impl<T> Sync for StructError<T>where
T: Sync,
impl<T> Unpin for StructError<T>
impl<T> UnwindSafe for StructError<T>where
T: UnwindSafe,
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