Enum fire_postgres::table::column::ColumnData
source · 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<ColumnData<'a>> for ColumnData<'a>
impl<'a> PartialEq<ColumnData<'a>> for ColumnData<'a>
source§fn eq(&self, other: &ColumnData<'a>) -> bool
fn eq(&self, other: &ColumnData<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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> 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.