Skip to main content

ToUpdateValue

Trait ToUpdateValue 

Source
pub trait ToUpdateValue {
    // Required method
    fn to_update_value(self) -> Option<String>;
}
Expand description

Trait for types that can be converted to an optional string value for SQL updates.

This trait is used by the update method to handle both direct values (e.g., update("role", "admin")) and NULL values (e.g., update("role", None::<String>)).

Required Methods§

Source

fn to_update_value(self) -> Option<String>

Converts the value to an Option<String> for SQL binding.

§Returns
  • Some(String) - String representation for a database value
  • None - Represents a SQL NULL

Implementations on Foreign Types§

Source§

impl ToUpdateValue for &str

Source§

impl ToUpdateValue for Option<&str>

Source§

impl ToUpdateValue for Option<bool>

Source§

impl ToUpdateValue for Option<f32>

Source§

impl ToUpdateValue for Option<f64>

Source§

impl ToUpdateValue for Option<i8>

Source§

impl ToUpdateValue for Option<i16>

Source§

impl ToUpdateValue for Option<i32>

Source§

impl ToUpdateValue for Option<i64>

Source§

impl ToUpdateValue for Option<isize>

Source§

impl ToUpdateValue for Option<u8>

Source§

impl ToUpdateValue for Option<u16>

Source§

impl ToUpdateValue for Option<u32>

Source§

impl ToUpdateValue for Option<u64>

Source§

impl ToUpdateValue for Option<usize>

Source§

impl ToUpdateValue for Option<String>

Source§

impl ToUpdateValue for Option<DateTime<FixedOffset>>

Source§

impl ToUpdateValue for Option<DateTime<Utc>>

Source§

impl ToUpdateValue for Option<NaiveDate>

Source§

impl ToUpdateValue for Option<NaiveDateTime>

Source§

impl ToUpdateValue for Option<NaiveTime>

Source§

impl ToUpdateValue for Option<Uuid>

Source§

impl ToUpdateValue for bool

Source§

impl ToUpdateValue for f32

Source§

impl ToUpdateValue for f64

Source§

impl ToUpdateValue for i8

Source§

impl ToUpdateValue for i16

Source§

impl ToUpdateValue for i32

Source§

impl ToUpdateValue for i64

Source§

impl ToUpdateValue for isize

Source§

impl ToUpdateValue for u8

Source§

impl ToUpdateValue for u16

Source§

impl ToUpdateValue for u32

Source§

impl ToUpdateValue for u64

Source§

impl ToUpdateValue for usize

Source§

impl ToUpdateValue for String

Source§

impl ToUpdateValue for DateTime<FixedOffset>

Source§

impl ToUpdateValue for DateTime<Utc>

Source§

impl ToUpdateValue for NaiveDate

Source§

impl ToUpdateValue for NaiveDateTime

Source§

impl ToUpdateValue for NaiveTime

Source§

impl ToUpdateValue for Uuid

Implementors§