pub trait QueryValue: Sized {
// Required method
fn from_view(view: &ViewValue) -> Result<Self, ZeroValueError>;
// Provided method
fn update_from_view(
&mut self,
previous: &mut ViewValue,
view: &ViewValue,
) -> Result<(), ZeroValueError> { ... }
}Expand description
What a query materializes to: its rows (Vec<Row>, Option<Row> after
one()), or the value of an aggregate, such as the i64 of count().
Required Methods§
Sourcefn from_view(view: &ViewValue) -> Result<Self, ZeroValueError>
fn from_view(view: &ViewValue) -> Result<Self, ZeroValueError>
Reads the query’s result from its view.
Provided Methods§
Sourcefn update_from_view(
&mut self,
previous: &mut ViewValue,
view: &ViewValue,
) -> Result<(), ZeroValueError>
fn update_from_view( &mut self, previous: &mut ViewValue, view: &ViewValue, ) -> Result<(), ZeroValueError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl QueryValue for i64
The value of count().
impl QueryValue for i64
The value of count().
Source§impl<E: QueryElement> QueryValue for Vec<E>
impl<E: QueryElement> QueryValue for Vec<E>
Source§fn update_from_view(
&mut self,
previous: &mut ViewValue,
view: &ViewValue,
) -> Result<(), ZeroValueError>
fn update_from_view( &mut self, previous: &mut ViewValue, view: &ViewValue, ) -> Result<(), ZeroValueError>
Keeps the rows whose entries are equal, and reads the others (the
Swift client’s RowCache). Most updates change a few rows in place,
or insert or remove one, so the entries are matched in order,
skipping at most one. previous becomes a copy of the entries
changed in the same way, so the view, which then shares its rows with
nothing, changes them in place.