Trait diesel::result::OptionalEmptyChangesetExtension

source ·
pub trait OptionalEmptyChangesetExtension<T> {
    // Required method
    fn optional_empty_changeset(self) -> Result<Option<T>, Error>;
}
Expand description

Required Methods§

source

fn optional_empty_changeset(self) -> Result<Option<T>, Error>

By default, Diesel treats an empty update as a QueryBuilderError. This method will convert that error into None.

§Example
use diesel::{QueryResult, OptionalEmptyChangesetExtension, result::Error::QueryBuilderError, result::EmptyChangeset};
let result: QueryResult<i32> = Err(QueryBuilderError(Box::new(EmptyChangeset)));
assert_eq!(Ok(None), result.optional_empty_changeset());

Implementors§