Enum perseus::template::BlamedGeneratorResult
source · pub enum BlamedGeneratorResult<T> {
Ok(T),
Err(BlamedError<Box<dyn Error + Send + Sync>>),
}
Expand description
The same as GeneratorResult
, except this uses a GenericBlamedError
as its error type, which is essentially a Box
ed generic error with an
attached ErrorBlame
denoting who is responsible for the error: the
client or the server. You’ll see this as a convertion type in the signatures
of functions that might be run at reuqest-time (e.g. get_request_state
might have an error caused by a missing file, which would be the server’s
fault, or a malformed cookie, which would be the client’s fault).
For a function that returns Into<BlamedGeneratorResult<T>>
, you can return
either T
directly, or Result<T, BlamedError<E>>
: see BlamedError
for
further information. (Note that the ?
operator can automatically turn E
into BlamedError<E>
, setting the server as the one to blame.)
Variants§
Ok(T)
Equivalent to Result::Ok
.
Err(BlamedError<Box<dyn Error + Send + Sync>>)
Equivalent to Result::Err
.