[−][src]Trait aragog::Update
The Update
trait of the Aragog library.
This trait provides the possibility to update a Type from an other one. Its main use
it to apply modifications from a Http form on a Record
model instance.
Required methods
fn update(&mut self, form: &T) -> Result<(), ServiceError>
Update the Self
field values T
. The object takes a mutable reference of itself and is directly
updated.
Can fail and return an error, the error is in most of the cases a ServiceError
::ValidationError
on fields validation failure
Provided methods
fn update_field_from_option<U>(value: &mut U, new_value: &Option<U>) where
U: Clone,
U: Clone,
Can update a mutable value
with a new one if the new_value
is defined (Some
).
if the new_value
is None
the value stays unchanged