pub enum PostgresUpdateValue<'a, V: SQLParam, T, Target: DataType = Any, TargetNull: Nullability = Null> {
Skip,
Null,
Value(ValueWrapper<'a, V, (T, Target, TargetNull)>),
}Expand description
One column in an UPDATE ... SET: skipped, NULL, or a value or SQL expression.
Generated Update* models store their fields as this type. T is the
column’s Rust type; Target and TargetNull are the column’s SQL type
and nullability, used to check what can be assigned.
Variants§
Skip
Leave the column out of SET, so it keeps its current value.
Null
Set the column to NULL.
Value(ValueWrapper<'a, V, (T, Target, TargetNull)>)
Set the column to a bound value, placeholder or SQL expression.
Implementations§
Source§impl<V: SQLParam, T, Target: DataType, TargetNull: Nullability> PostgresUpdateValue<'_, V, T, Target, TargetNull>
impl<V: SQLParam, T, Target: DataType, TargetNull: Nullability> PostgresUpdateValue<'_, V, T, Target, TargetNull>
Trait Implementations§
Source§impl<'a, V: Clone + SQLParam, T: Clone, Target: Clone + DataType, TargetNull: Clone + Nullability> Clone for PostgresUpdateValue<'a, V, T, Target, TargetNull>
impl<'a, V: Clone + SQLParam, T: Clone, Target: Clone + DataType, TargetNull: Clone + Nullability> Clone for PostgresUpdateValue<'a, V, T, Target, TargetNull>
Source§impl<'a, V: Debug + SQLParam, T: Debug, Target: Debug + DataType, TargetNull: Debug + Nullability> Debug for PostgresUpdateValue<'a, V, T, Target, TargetNull>
impl<'a, V: Debug + SQLParam, T: Debug, Target: Debug + DataType, TargetNull: Debug + Nullability> Debug for PostgresUpdateValue<'a, V, T, Target, TargetNull>
Source§impl<'a, V: SQLParam, T, Target: DataType, TargetNull: Nullability> Default for PostgresUpdateValue<'a, V, T, Target, TargetNull>
impl<'a, V: SQLParam, T, Target: DataType, TargetNull: Nullability> Default for PostgresUpdateValue<'a, V, T, Target, TargetNull>
Source§impl<'a, Target, TargetNull> From<&str> for PostgresUpdateValue<'a, PostgresValue<'a>, String, Target, TargetNull>where
Target: DataType,
TargetNull: Nullability,
impl<'a, Target, TargetNull> From<&str> for PostgresUpdateValue<'a, PostgresValue<'a>, String, Target, TargetNull>where
Target: DataType,
TargetNull: Nullability,
Source§impl<'a, T, Target, TargetNull, L, R, Op, Actual, ActualNull> From<ColumnBinOp<L, R, Op, PostgresDialect, Actual, ActualNull>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
Target: DataType + Assignable<Actual>,
TargetNull: Nullability + AcceptsNullability<ActualNull>,
Actual: DataType,
ActualNull: Nullability,
ColumnBinOp<L, R, Op, PostgresDialect, Actual, ActualNull>: ToSQL<'a, PostgresValue<'a>>,
impl<'a, T, Target, TargetNull, L, R, Op, Actual, ActualNull> From<ColumnBinOp<L, R, Op, PostgresDialect, Actual, ActualNull>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
Target: DataType + Assignable<Actual>,
TargetNull: Nullability + AcceptsNullability<ActualNull>,
Actual: DataType,
ActualNull: Nullability,
ColumnBinOp<L, R, Op, PostgresDialect, Actual, ActualNull>: ToSQL<'a, PostgresValue<'a>>,
Source§fn from(
value: ColumnBinOp<L, R, Op, PostgresDialect, Actual, ActualNull>,
) -> Self
fn from( value: ColumnBinOp<L, R, Op, PostgresDialect, Actual, ActualNull>, ) -> Self
Converts to this type from the input type.
Source§impl<'a, T, Target, TargetNull, E, Actual, ActualNull> From<ColumnNeg<E, PostgresDialect, Actual, ActualNull>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
Target: DataType + Assignable<Actual>,
TargetNull: Nullability + AcceptsNullability<ActualNull>,
Actual: DataType,
ActualNull: Nullability,
ColumnNeg<E, PostgresDialect, Actual, ActualNull>: ToSQL<'a, PostgresValue<'a>>,
impl<'a, T, Target, TargetNull, E, Actual, ActualNull> From<ColumnNeg<E, PostgresDialect, Actual, ActualNull>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
Target: DataType + Assignable<Actual>,
TargetNull: Nullability + AcceptsNullability<ActualNull>,
Actual: DataType,
ActualNull: Nullability,
ColumnNeg<E, PostgresDialect, Actual, ActualNull>: ToSQL<'a, PostgresValue<'a>>,
Source§fn from(value: ColumnNeg<E, PostgresDialect, Actual, ActualNull>) -> Self
fn from(value: ColumnNeg<E, PostgresDialect, Actual, ActualNull>) -> Self
Converts to this type from the input type.
Source§impl<'a, C, T, Target, TargetNull, Actual, ActualNull> From<Excluded<C>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
C: SQLColumnInfo + Expr<'a, PostgresValue<'a>, SQLType = Actual, Nullable = ActualNull>,
Target: DataType + Assignable<Actual>,
TargetNull: Nullability + AcceptsNullability<ActualNull>,
Actual: DataType,
ActualNull: Nullability,
impl<'a, C, T, Target, TargetNull, Actual, ActualNull> From<Excluded<C>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
C: SQLColumnInfo + Expr<'a, PostgresValue<'a>, SQLType = Actual, Nullable = ActualNull>,
Target: DataType + Assignable<Actual>,
TargetNull: Nullability + AcceptsNullability<ActualNull>,
Actual: DataType,
ActualNull: Nullability,
Source§impl<'a, T, Target, TargetNull> From<Placeholder> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
Target: DataType,
TargetNull: Nullability,
impl<'a, T, Target, TargetNull> From<Placeholder> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
Target: DataType,
TargetNull: Nullability,
Source§fn from(placeholder: Placeholder) -> Self
fn from(placeholder: Placeholder) -> Self
Converts to this type from the input type.
Source§impl<'a, T, Target, TargetNull, Actual, ActualNull, Sources> From<SQLExpr<'a, PostgresValue<'a>, Actual, ActualNull, Scalar, Sources>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
Target: DataType + Assignable<Actual>,
TargetNull: Nullability + AcceptsNullability<ActualNull>,
Actual: DataType,
ActualNull: Nullability,
impl<'a, T, Target, TargetNull, Actual, ActualNull, Sources> From<SQLExpr<'a, PostgresValue<'a>, Actual, ActualNull, Scalar, Sources>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
Target: DataType + Assignable<Actual>,
TargetNull: Nullability + AcceptsNullability<ActualNull>,
Actual: DataType,
ActualNull: Nullability,
Source§impl<'a, T, Target, TargetNull> From<T> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>
Converts any value that converts to a PostgresValue.
impl<'a, T, Target, TargetNull> From<T> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>
Converts any value that converts to a PostgresValue.
§Panics
Panics when the value fails to convert (a JSON payload that fails to serialize, for example), rather than storing NULL in its place.
Source§impl<'a, M, N, T, Target, TargetNull> From<TypedPlaceholder<M, N>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
M: DataType,
N: Nullability,
Target: DataType + Assignable<M>,
TargetNull: Nullability + AcceptsNullability<N>,
impl<'a, M, N, T, Target, TargetNull> From<TypedPlaceholder<M, N>> for PostgresUpdateValue<'a, PostgresValue<'a>, T, Target, TargetNull>where
M: DataType,
N: Nullability,
Target: DataType + Assignable<M>,
TargetNull: Nullability + AcceptsNullability<N>,
Source§fn from(typed: TypedPlaceholder<M, N>) -> Self
fn from(typed: TypedPlaceholder<M, N>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a, V, T, Target, TargetNull> Freeze for PostgresUpdateValue<'a, V, T, Target, TargetNull>where
ValueWrapper<'a, V, (T, Target, TargetNull)>: Freeze,
impl<'a, V, T, Target, TargetNull> RefUnwindSafe for PostgresUpdateValue<'a, V, T, Target, TargetNull>where
ValueWrapper<'a, V, (T, Target, TargetNull)>: RefUnwindSafe,
impl<'a, V, T, Target, TargetNull> Send for PostgresUpdateValue<'a, V, T, Target, TargetNull>where
ValueWrapper<'a, V, (T, Target, TargetNull)>: Send,
impl<'a, V, T, Target, TargetNull> Sync for PostgresUpdateValue<'a, V, T, Target, TargetNull>where
ValueWrapper<'a, V, (T, Target, TargetNull)>: Sync,
impl<'a, V, T, Target, TargetNull> Unpin for PostgresUpdateValue<'a, V, T, Target, TargetNull>where
ValueWrapper<'a, V, (T, Target, TargetNull)>: Unpin,
impl<'a, V, T, Target, TargetNull> UnsafeUnpin for PostgresUpdateValue<'a, V, T, Target, TargetNull>where
ValueWrapper<'a, V, (T, Target, TargetNull)>: UnsafeUnpin,
impl<'a, V, T, Target, TargetNull> UnwindSafe for PostgresUpdateValue<'a, V, T, Target, TargetNull>where
ValueWrapper<'a, V, (T, Target, TargetNull)>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more