#[non_exhaustive]
pub enum MaybeCached<'a, T: 'a> {
    CannotCache(T),
    Cached(&'a mut T),
}
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
Expand description

Wraps a possibly cached prepared statement

Essentially a customized version of Cow that does not depend on ToOwned

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

CannotCache(T)

Contains a not cached prepared statement

§

Cached(&'a mut T)

Contains a reference cached prepared statement

Trait Implementations§

The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Convert self to an expression for Diesel’s query builder. Read more
Convert &self to an expression for Diesel’s query builder. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.