pub type QueryResult<T> = Result<T, Error>;
Expand description
A specialized result type for queries.
This type is exported by diesel::prelude
, and is generally used by any
code which is interacting with Diesel. This type exists to avoid writing out
diesel::result::Error
, and is otherwise a direct mapping to Result
.
Aliased Type§
enum QueryResult<T> {
Ok(T),
Err(Error),
}
Variants§
Trait Implementations§
Source§impl<T> OptionalEmptyChangesetExtension<T> for QueryResult<T>
impl<T> OptionalEmptyChangesetExtension<T> for QueryResult<T>
Source§impl<T> OptionalExtension<T> for QueryResult<T>
impl<T> OptionalExtension<T> for QueryResult<T>
Source§impl<S, C> StatementCallbackReturnType<S, C> for QueryResult<S>where
S: 'static,
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes
only.
impl<S, C> StatementCallbackReturnType<S, C> for QueryResult<S>where
S: 'static,
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes
only.Source§type Return<'a> = Result<MaybeCached<'a, S>, Error>
type Return<'a> = Result<MaybeCached<'a, S>, Error>
The return type of
StatementCache::cached_statement
Read moreSource§fn from_error<'a>(e: Error) -> Self::Return<'a>
fn from_error<'a>(e: Error) -> Self::Return<'a>
Create the return type from an error
Source§fn map_to_no_cache<'a>(self) -> Self::Return<'a>
fn map_to_no_cache<'a>(self) -> Self::Return<'a>
Map the callback return type to the
MaybeCached::CannotCache
variantSource§fn map_to_cache(stmt: &mut S, _conn: C) -> Self::Return<'_>
fn map_to_cache(stmt: &mut S, _conn: C) -> Self::Return<'_>
Map the cached statement to the
MaybeCached::Cached
variant