pub enum ColumnData<'a> {
Boolean(bool),
Text(Text<'a>),
Date(i32),
Timestamp(i64),
F64(f64),
F32(f32),
I64(i64),
I32(i32),
I16(i16),
Option(Option<Box<ColumnData<'a>>>),
TextArray(TextArray<'a>),
Bytea(&'a [u8]),
}
Variants§
Boolean(bool)
Text(Text<'a>)
Date(i32)
Timestamp(i64)
F64(f64)
F32(f32)
I64(i64)
I32(i32)
I16(i16)
Option(Option<Box<ColumnData<'a>>>)
TextArray(TextArray<'a>)
Bytea(&'a [u8])
Implementations§
Source§impl<'a> ColumnData<'a>
impl<'a> ColumnData<'a>
pub fn is_null(&self) -> bool
pub fn unwrap_text(self) -> Text<'a>
Trait Implementations§
Source§impl<'a> Clone for ColumnData<'a>
impl<'a> Clone for ColumnData<'a>
Source§fn clone(&self) -> ColumnData<'a>
fn clone(&self) -> ColumnData<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for ColumnData<'a>
impl<'a> Debug for ColumnData<'a>
Source§impl<'a> FromSql<'a> for ColumnData<'a>
impl<'a> FromSql<'a> for ColumnData<'a>
Source§fn from_sql(
ty: &Type,
raw: &'a [u8],
) -> Result<Self, Box<dyn Error + Send + Sync + 'static>>
fn from_sql( ty: &Type, raw: &'a [u8], ) -> Result<Self, Box<dyn Error + Send + Sync + 'static>>
Creates a new value of this type from a buffer of data of the specified
Postgres
Type
in its binary format. Read moreSource§fn from_sql_null(_: &Type) -> Result<Self, Box<dyn Error + Sync + Send>>
fn from_sql_null(_: &Type) -> Result<Self, Box<dyn Error + Sync + Send>>
Creates a new value of this type from a
NULL
SQL value. Read moreSource§impl<'a> PartialEq for ColumnData<'a>
impl<'a> PartialEq for ColumnData<'a>
Source§impl<'a> ToSql for ColumnData<'a>
impl<'a> ToSql for ColumnData<'a>
Source§fn to_sql(
&self,
_ty: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Send + Sync + 'static>>
fn to_sql( &self, _ty: &Type, out: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Send + Sync + 'static>>
Converts the value of
self
into the binary format of the specified
Postgres Type
, appending it to out
. Read moreSource§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
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
impl<'a> StructuralPartialEq for ColumnData<'a>
Auto Trait Implementations§
impl<'a> Freeze for ColumnData<'a>
impl<'a> RefUnwindSafe for ColumnData<'a>
impl<'a> Send for ColumnData<'a>
impl<'a> Sync for ColumnData<'a>
impl<'a> Unpin for ColumnData<'a>
impl<'a> UnwindSafe for ColumnData<'a>
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
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.