Skip to main content

ToSql

Trait ToSql 

Source
pub trait ToSql: Send + Sync {
    // Required methods
    fn to_sql(&self) -> Result<Vec<u8>, PgError>;
    fn pg_type(&self) -> &'static PgType;
}

Required Methods§

Source

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source

fn pg_type(&self) -> &'static PgType

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ToSql for &[u8]

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for &str

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for DateTime<Utc>

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for String

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for Uuid

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for Vec<u8>

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for bool

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for f32

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for f64

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for i16

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for i32

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl ToSql for i64

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl<T: ToSql> ToSql for &[T]

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl<T: ToSql> ToSql for Option<T>

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Source§

impl<T: ToSql> ToSql for Vec<T>

Source§

fn to_sql(&self) -> Result<Vec<u8>, PgError>

Source§

fn pg_type(&self) -> &'static PgType

Implementors§

Source§

impl<I, T> ToSql for BindIter<I>
where I: Iterator<Item = T> + Send, T: ToSql,