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

Trait Implementations§

source§

impl<T: Debug> Debug for BlamedGeneratorResult<T>

source§

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

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

impl<S: Serialize + DeserializeOwned + MakeRx, E: Into<Box<dyn Error + Send + Sync + 'static>> + Send + Sync> From<Result<S, BlamedError<E>>> for BlamedGeneratorResult<S>

source§

fn from(val: Result<S, BlamedError<E>>) -> Self

Converts to this type from the input type.
source§

impl<E: Into<Box<dyn Error + Send + Sync + 'static>> + Send + Sync> From<Result<bool, BlamedError<E>>> for BlamedGeneratorResult<bool>

source§

fn from(val: Result<bool, BlamedError<E>>) -> Self

Converts to this type from the input type.
source§

impl<S: Serialize + DeserializeOwned + MakeRx> From<S> for BlamedGeneratorResult<S>

source§

fn from(val: S) -> Self

Converts to this type from the input type.
source§

impl From<bool> for BlamedGeneratorResult<bool>

source§

fn from(val: bool) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for BlamedGeneratorResult<T>

§

impl<T> Send for BlamedGeneratorResult<T>where T: Send,

§

impl<T> Sync for BlamedGeneratorResult<T>where T: Sync,

§

impl<T> Unpin for BlamedGeneratorResult<T>where T: Unpin,

§

impl<T> !UnwindSafe for BlamedGeneratorResult<T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.