pub trait Update<T> {
// Required method
fn update(&mut self, form: &T) -> Result<(), Error>;
// Provided method
fn update_field_from_option<U>(value: &mut U, new_value: &Option<U>)
where U: Clone { ... }
}
Expand description
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§
Provided Methods§
sourcefn update_field_from_option<U>(value: &mut U, new_value: &Option<U>)where
U: Clone,
fn update_field_from_option<U>(value: &mut U, new_value: &Option<U>)where 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
Object Safety§
This trait is not object safe.