StructError

Struct StructError 

Source
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.

Source

pub fn imp(&self) -> &Box<StructErrorImpl<T>>

Get field imp from instance of StructError.

Source§

impl<T: DomainReason> StructError<T>

Source

pub fn new( reason: T, detail: Option<String>, position: Option<String>, context: Vec<OperationContext>, ) -> Self

Source§

impl<T: DomainReason> StructError<T>

Source

pub fn with_position(self, position: impl Into<String>) -> Self

使用示例 self.with_position(location!());

Source

pub fn with_context(self, context: CallContext) -> Self

Source

pub fn with_detail(self, detail: impl Into<String>) -> Self

Source

pub fn err<V>(self) -> Result<V, Self>

Source

pub fn target(&self) -> Option<String>

Trait Implementations§

Source§

impl<T: Clone + DomainReason> Clone for StructError<T>

Source§

fn clone(&self) -> StructError<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R1, R2> ConvStructError<R2> for StructError<R1>
where R1: DomainReason, R2: DomainReason + From<R1>,

Source§

fn conv(self) -> StructError<R2>

Source§

impl<T: Debug + DomainReason> Debug for StructError<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: DomainReason> Deref for StructError<T>

Source§

type Target = StructErrorImpl<T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: Display + DomainReason + ErrorCode> Display for StructError<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: DomainReason> Error for StructError<T>
where Self: Debug + Display,

1.30.0 · Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl<T: DomainReason + ErrorCode> ErrorCode for StructError<T>

Source§

fn error_code(&self) -> i32

Source§

impl<T: DomainReason> ErrorWith for StructError<T>

Source§

fn want<S: Into<String>>(self, desc: S) -> Self

Source§

fn position<S: Into<String>>(self, pos: S) -> Self

Source§

fn with<C: Into<OperationContext>>(self, ctx: C) -> Self

Source§

impl<T> From<T> for StructError<T>
where T: DomainReason,

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl<T: PartialEq + DomainReason> PartialEq for StructError<T>

Source§

fn eq(&self, other: &StructError<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: DomainReason> Serialize for StructError<T>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T: DomainReason> StructErrorTrait<T> for StructError<T>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<R> ToStructError<R> for R
where R: DomainReason,

Source§

fn to_err(self) -> StructError<R>

Source§

fn err_result<T>(self) -> Result<T, StructError<R>>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UvsBizFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_biz(info: &str) -> T

Source§

impl<T> UvsBizFrom<String> for T
where T: From<UvsReason>,

Source§

fn from_biz(info: String) -> T

Source§

impl<T> UvsConfFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_conf(reason: &str) -> T

Source§

impl<T> UvsConfFrom<ConfErrReason> for T
where T: From<UvsReason>,

Source§

impl<T> UvsConfFrom<String> for T
where T: From<UvsReason>,

Source§

fn from_conf(reason: String) -> T

Source§

impl<T> UvsDataFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_data(info: &str, pos: Option<usize>) -> T

Source§

impl<T> UvsDataFrom<String> for T
where T: From<UvsReason>,

Source§

fn from_data(info: String, pos: Option<usize>) -> T

Source§

impl<T> UvsExternalFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_external(info: &str) -> T

Source§

impl<T> UvsExternalFrom<String> for T
where T: From<UvsReason>,

Source§

impl<T> UvsLogicFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_logic(info: &str) -> T

Source§

impl<T> UvsLogicFrom<String> for T
where T: From<UvsReason>,

Source§

fn from_logic(info: String) -> T

Source§

impl<T> UvsNetFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_net(info: &str) -> T

Source§

impl<T> UvsNetFrom<String> for T
where T: From<UvsReason>,

Source§

fn from_net(info: String) -> T

Source§

impl<T> UvsNotFoundFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_not_found(info: &str) -> T

Source§

impl<T> UvsNotFoundFrom<String> for T
where T: From<UvsReason>,

Source§

impl<T> UvsPermissionFrom<&str> for T
where T: From<UvsReason>,

Source§

impl<T> UvsPermissionFrom<String> for T
where T: From<UvsReason>,

Source§

impl<T> UvsResFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_res(info: &str) -> T

Source§

impl<T> UvsResFrom<String> for T
where T: From<UvsReason>,

Source§

fn from_res(info: String) -> T

Source§

impl<T> UvsSysFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_sys(info: &str) -> T

Source§

impl<T> UvsSysFrom<String> for T
where T: From<UvsReason>,

Source§

fn from_sys(info: String) -> T

Source§

impl<T> UvsTimeoutFrom<&str> for T
where T: From<UvsReason>,

Source§

fn from_timeout(info: &str) -> T

Source§

impl<T> UvsTimeoutFrom<String> for T
where T: From<UvsReason>,

Source§

impl<T> UvsValidationFrom<&str> for T
where T: From<UvsReason>,

Source§

impl<T> UvsValidationFrom<String> for T
where T: From<UvsReason>,

Source§

impl<T> DomainReason for T