pub enum OwnedParam {
Null,
Bool(bool),
I64(i64),
F64(f64),
Text(String),
Blob(Vec<u8>),
}Expand description
Owned SQL parameter that implements ToSql.
tokio-postgres expects &[&(dyn ToSql + Sync)] parameters. Since our
source values live in a Vec<Value>, we first convert them to this owned
enum, collect references, then pass a slice.
Variants§
Null
SQL NULL.
Bool(bool)
Boolean.
I64(i64)
64-bit signed integer.
F64(f64)
64-bit float.
Text(String)
UTF-8 string.
Blob(Vec<u8>)
Binary blob.
Trait Implementations§
Source§impl Debug for OwnedParam
impl Debug for OwnedParam
Source§impl ToSql for OwnedParam
impl ToSql for OwnedParam
Source§fn to_sql(
&self,
ty: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql( &self, ty: &Type, out: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
Converts the value of
self into the binary format of the specified
Postgres Type, appending it to out. Read moreSource§fn accepts(_ty: &Type) -> boolwhere
Self: Sized,
fn accepts(_ty: &Type) -> boolwhere
Self: Sized,
Determines if a value of this type can be converted to the specified
Postgres
Type.Source§fn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
An adaptor method used internally by Rust-Postgres. Read more
Source§fn encode_format(&self, _ty: &Type) -> Format
fn encode_format(&self, _ty: &Type) -> Format
Specify the encode format
Auto Trait Implementations§
impl Freeze for OwnedParam
impl RefUnwindSafe for OwnedParam
impl Send for OwnedParam
impl Sync for OwnedParam
impl Unpin for OwnedParam
impl UnsafeUnpin for OwnedParam
impl UnwindSafe for OwnedParam
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> BorrowToSql for Twhere
T: ToSql,
impl<T> BorrowToSql for Twhere
T: ToSql,
Source§fn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
Returns a reference to
self as a ToSql trait object.