Skip to main content

Assign

Trait Assign 

Source
pub trait Assign<T> {
    // Required method
    fn into_assignment(self) -> Assignment<T>;

    // Provided method
    fn assign(self, assignments: &mut Assignments, projection: Projection)
       where Self: Sized { ... }
}
Expand description

Apply a field mutation to an update statement’s Assignments map.

Every update builder setter accepts impl Assign<T>. All types that implement IntoExpr<T> also implement Assign<T> with set semantics, so update setters accept the same types as create setters.

For has-many fields, arrays and Vecs implement Assign<List<T>> with set (replace) semantics. Use insert, remove, or apply for incremental mutations.

Required Methods§

Source

fn into_assignment(self) -> Assignment<T>

Convert into an Assignment<T> value.

Provided Methods§

Source

fn assign(self, assignments: &mut Assignments, projection: Projection)
where Self: Sized,

Record one or more assignments into the given [Assignments] map at the specified projection.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Assign<Option<String>> for &str

Source§

impl Assign<String> for &str

Source§

impl Assign<String> for String

Source§

impl Assign<Uuid> for Uuid

Source§

impl Assign<Vec<u8>> for Vec<u8>

Source§

impl Assign<bool> for bool

Source§

impl Assign<f32> for f32

Source§

impl Assign<f64> for f64

Source§

impl Assign<i8> for i8

Source§

impl Assign<i16> for i16

Source§

impl Assign<i32> for i32

Source§

impl Assign<i64> for i64

Source§

impl Assign<isize> for isize

Source§

impl Assign<u8> for u8

Source§

impl Assign<u16> for u16

Source§

impl Assign<u32> for u32

Source§

impl Assign<u64> for u64

Source§

impl Assign<usize> for usize

Source§

impl<T0, E0, T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6, T7, E7, T8, E8, T9, E9> Assign<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for (E0, E1, E2, E3, E4, E5, E6, E7, E8, E9)
where E0: IntoExpr<T0>, E1: IntoExpr<T1>, E2: IntoExpr<T2>, E3: IntoExpr<T3>, E4: IntoExpr<T4>, E5: IntoExpr<T5>, E6: IntoExpr<T6>, E7: IntoExpr<T7>, E8: IntoExpr<T8>, E9: IntoExpr<T9>,

Source§

impl<T0, E0, T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6, T7, E7, T8, E8> Assign<(T0, T1, T2, T3, T4, T5, T6, T7, T8)> for (E0, E1, E2, E3, E4, E5, E6, E7, E8)
where E0: IntoExpr<T0>, E1: IntoExpr<T1>, E2: IntoExpr<T2>, E3: IntoExpr<T3>, E4: IntoExpr<T4>, E5: IntoExpr<T5>, E6: IntoExpr<T6>, E7: IntoExpr<T7>, E8: IntoExpr<T8>,

Source§

impl<T0, E0, T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6, T7, E7> Assign<(T0, T1, T2, T3, T4, T5, T6, T7)> for (E0, E1, E2, E3, E4, E5, E6, E7)
where E0: IntoExpr<T0>, E1: IntoExpr<T1>, E2: IntoExpr<T2>, E3: IntoExpr<T3>, E4: IntoExpr<T4>, E5: IntoExpr<T5>, E6: IntoExpr<T6>, E7: IntoExpr<T7>,

Source§

impl<T0, E0, T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6> Assign<(T0, T1, T2, T3, T4, T5, T6)> for (E0, E1, E2, E3, E4, E5, E6)
where E0: IntoExpr<T0>, E1: IntoExpr<T1>, E2: IntoExpr<T2>, E3: IntoExpr<T3>, E4: IntoExpr<T4>, E5: IntoExpr<T5>, E6: IntoExpr<T6>,

Source§

impl<T0, E0, T1, E1, T2, E2, T3, E3, T4, E4, T5, E5> Assign<(T0, T1, T2, T3, T4, T5)> for (E0, E1, E2, E3, E4, E5)
where E0: IntoExpr<T0>, E1: IntoExpr<T1>, E2: IntoExpr<T2>, E3: IntoExpr<T3>, E4: IntoExpr<T4>, E5: IntoExpr<T5>,

Source§

impl<T0, E0, T1, E1, T2, E2, T3, E3, T4, E4> Assign<(T0, T1, T2, T3, T4)> for (E0, E1, E2, E3, E4)
where E0: IntoExpr<T0>, E1: IntoExpr<T1>, E2: IntoExpr<T2>, E3: IntoExpr<T3>, E4: IntoExpr<T4>,

Source§

impl<T0, E0, T1, E1, T2, E2, T3, E3> Assign<(T0, T1, T2, T3)> for (E0, E1, E2, E3)
where E0: IntoExpr<T0>, E1: IntoExpr<T1>, E2: IntoExpr<T2>, E3: IntoExpr<T3>,

Source§

impl<T0, E0, T1, E1, T2, E2> Assign<(T0, T1, T2)> for (E0, E1, E2)
where E0: IntoExpr<T0>, E1: IntoExpr<T1>, E2: IntoExpr<T2>,

Source§

impl<T0, E0, T1, E1> Assign<(T0, T1)> for (E0, E1)
where E0: IntoExpr<T0>, E1: IntoExpr<T1>,

Source§

impl<T0, E0> Assign<(T0,)> for (E0,)
where E0: IntoExpr<T0>,

Source§

impl<T, E> Assign<List<T>> for &[E]
where E: IntoExpr<T>,

Source§

impl<T, U, const N: usize> Assign<List<T>> for &[U; N]
where U: IntoExpr<T>,

Source§

impl<T, U, const N: usize> Assign<List<T>> for [U; N]
where U: IntoExpr<T>,

Source§

impl<T, U> Assign<List<T>> for Vec<U>
where U: IntoExpr<T>,

Source§

impl<T> Assign<Option<T>> for &T
where T: IntoExpr<T>,

Source§

impl<T> Assign<Option<T>> for Option<T>
where T: IntoExpr<T>,

Source§

impl<T> Assign<T> for &T
where T: IntoExpr<T>,

Implementors§

Source§

impl<T> Assign<Arc<T>> for T
where T: IntoExpr<T>,

Source§

impl<T> Assign<Box<T>> for T
where T: IntoExpr<T>,

Source§

impl<T> Assign<Json<T>> for Json<T>
where T: Serialize,

Source§

impl<T> Assign<Json<T>> for T
where T: Serialize,

Mirrors the IntoExpr<Json<T>> for T blanket on the assignment side so update builders accept a bare value too:

ⓘ
repo.update().payload(payload.clone()).exec(&mut db).await?;
Source§

impl<T> Assign<Option<T>> for T
where T: IntoExpr<T>,

Source§

impl<T> Assign<Rc<T>> for T
where T: IntoExpr<T>,

Source§

impl<T> Assign<T> for Assignment<T>

Source§

impl<T> Assign<T> for Expr<T>