Struct askama::Error
[−]
.html#31-34' title='goto source code'>[src]
pub struct Error(pub ErrorKind, _);
The Error type.
This tuple struct is made of two elements:
- an
ErrorKindwhich is used to determine the type of the error. - An internal
State, not meant for direct use outside oferror_chaininternals, containing:- a backtrace, generated when the error is created.
- an error chain, used for the implementation of
Error::cause().
Methods
impl Error.html#50-75' title='goto source code'>[src]
fn from_kind(kind: ErrorKind) -> Error.html#52-53' title='goto source code'>[src]
Constructs an error from a kind, and generates a backtrace.
fn with_chain<E, K>(error: E, kind: K) -> Error where
E: Error + Send + 'static,
K: Into<ErrorKind>, .html#55-57' title='goto source code'>[src]
E: Error + Send + 'static,
K: Into<ErrorKind>,
Constructs a chained error from another error and a kind, and generates a backtrace.
fn with_boxed_chain<K>(error: Box<Error + 'static + Send>, kind: K) -> Error where
K: Into<ErrorKind>, .html#59-64' title='goto source code'>[src]
K: Into<ErrorKind>,
Construct a chained error from another boxed error and a kind, and generates a backtrace
fn kind(&self) -> &ErrorKind.html#65' title='goto source code'>[src]
Returns the kind of the error.
fn iter(&self) -> Iter.html#67-68' title='goto source code'>[src]
Iterates over the error chain.
fn backtrace(&self) -> Option<&Backtrace>.html#70-71' title='goto source code'>[src]
Returns the backtrace associated with this error.
fn chain_err<F, EK>(self, error: F) -> Error where
EK: Into<ErrorKind>,
F: FnOnce() -> EK, .html#72-75' title='goto source code'>[src]
EK: Into<ErrorKind>,
F: FnOnce() -> EK,
Extends the error chain with a new entry.
Trait Implementations
impl From<Error> for Error.html#93-97' title='goto source code'>[src]
impl From<Error> for Error.html#93-97' title='goto source code'>[src]
impl From<ErrorKind> for Error.html#97-99' title='goto source code'>[src]
fn from(e: ErrorKind) -> Error.html#98' title='goto source code'>[src]
impl<'a> From<&'a str> for Error.html#99-101' title='goto source code'>[src]
fn from(s: &'a str) -> Error.html#100-101' title='goto source code'>[src]
impl From<String> for Error.html#101-103' title='goto source code'>[src]
impl Deref for Error.html#103-105' title='goto source code'>[src]
type Target = ErrorKind
fn deref(&self) -> &<Error as Deref>::Target.html#104-105' title='goto source code'>[src]
impl ChainedError for Error.html#34-49' title='goto source code'>[src]
type ErrorKind = ErrorKind
fn new(kind: ErrorKind, state: State) -> Error.html#36-38' title='goto source code'>[src]
fn from_kind(kind: <Error as ChainedError>::ErrorKind) -> Error.html#38-39' title='goto source code'>[src]
fn with_chain<E, K>(error: E, kind: K) -> Error where
E: Error + Send + 'static,
K: Into<<Error as ChainedError>::ErrorKind>, .html#39-42' title='goto source code'>[src]
E: Error + Send + 'static,
K: Into<<Error as ChainedError>::ErrorKind>,
fn kind(&self) -> &<Error as ChainedError>::ErrorKind.html#42' title='goto source code'>[src]
fn iter(&self) -> Iter.html#42-43' title='goto source code'>[src]
fn chain_err<F, EK>(self, error: F) -> Error where
EK: Into<ErrorKind>,
F: FnOnce() -> EK, .html#43-45' title='goto source code'>[src]
EK: Into<ErrorKind>,
F: FnOnce() -> EK,