Struct schema_analysis::targets::json_typegen::JTError
source · pub struct JTError(pub ErrorKind, _);
Expand description
The Error type.
This tuple struct is made of two elements:
- an
ErrorKind
which is used to determine the type of the error. - An internal
State
, not meant for direct use outside oferror_chain
internals, containing:- a backtrace, generated when the error is created.
- an error chain, used for the implementation of
Error::cause()
.
Tuple Fields§
§0: ErrorKind
The kind of the error.
Implementations§
source§impl JTError
impl JTError
sourcepub fn from_kind(kind: ErrorKind) -> JTError
pub fn from_kind(kind: ErrorKind) -> JTError
Constructs an error from a kind, and generates a backtrace.
sourcepub fn with_chain<E, K>(error: E, kind: K) -> JTErrorwhere
E: Error + Send + 'static,
K: Into<ErrorKind>,
pub fn with_chain<E, K>(error: E, kind: K) -> JTErrorwhere
E: Error + Send + 'static,
K: Into<ErrorKind>,
Constructs a chained error from another error and a kind, and generates a backtrace.
sourcepub fn with_boxed_chain<K>(
error: Box<dyn Error + Send + 'static, Global>,
kind: K
) -> JTErrorwhere
K: Into<ErrorKind>,
pub fn with_boxed_chain<K>(
error: Box<dyn Error + Send + 'static, Global>,
kind: K
) -> JTErrorwhere
K: Into<ErrorKind>,
Construct a chained error from another boxed error and a kind, and generates a backtrace
sourcepub fn backtrace(&self) -> Option<&Backtrace>
pub fn backtrace(&self) -> Option<&Backtrace>
Returns the backtrace associated with this error.
sourcepub fn chain_err<F, EK>(self, error: F) -> JTErrorwhere
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
pub fn chain_err<F, EK>(self, error: F) -> JTErrorwhere
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
Extends the error chain with a new entry.
sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
A short description of the error.
This method is identical to Error::description()
Trait Implementations§
source§impl ChainedError for JTError
impl ChainedError for JTError
source§fn from_kind(kind: <JTError as ChainedError>::ErrorKind) -> JTError
fn from_kind(kind: <JTError as ChainedError>::ErrorKind) -> JTError
Constructs an error from a kind, and generates a backtrace.
source§fn with_chain<E, K>(error: E, kind: K) -> JTErrorwhere
E: Error + Send + 'static,
K: Into<<JTError as ChainedError>::ErrorKind>,
fn with_chain<E, K>(error: E, kind: K) -> JTErrorwhere
E: Error + Send + 'static,
K: Into<<JTError as ChainedError>::ErrorKind>,
Constructs a chained error from another error and a kind, and generates a backtrace.
source§fn chain_err<F, EK>(self, error: F) -> JTErrorwhere
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
fn chain_err<F, EK>(self, error: F) -> JTErrorwhere
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
Extends the error chain with a new entry.
source§fn display_chain<'a>(&'a self) -> DisplayChain<'a, Self>
fn display_chain<'a>(&'a self) -> DisplayChain<'a, Self>
Returns an object which implements
Display
for printing the full
context of this error. Read moresource§impl Error for JTError
impl Error for JTError
source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for JTError
impl Send for JTError
impl !Sync for JTError
impl Unpin for JTError
impl !UnwindSafe for JTError
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.