Struct apache_age::AgType
source · [−]pub struct AgType<T>(pub T);Expand description
Simple wrapper (similar to JSONB) that handles agtype serialization and deserialization
Tuple Fields
0: TTrait Implementations
sourceimpl<'de, T> Deserialize<'de> for AgType<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for AgType<T>where
T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'a, T> FromSql<'a> for AgType<T>where
T: Deserialize<'a>,
impl<'a, T> FromSql<'a> for AgType<T>where
T: Deserialize<'a>,
sourcefn from_sql(
ty: &Type,
raw: &'a [u8]
) -> Result<AgType<T>, Box<dyn Error + Sync + Send>>
fn from_sql(
ty: &Type,
raw: &'a [u8]
) -> Result<AgType<T>, Box<dyn Error + Sync + Send>>
Creates a new value of this type from a buffer of data of the specified
Postgres
Type in its binary format. Read moresourcefn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be created from the specified
Postgres
Type. Read moresourceimpl<T> ToSql for AgType<T>where
T: Serialize,
T: Debug,
impl<T> ToSql for AgType<T>where
T: Serialize,
T: Debug,
sourcefn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be converted to the specified
Postgres
Type. Read moresourcefn to_sql(
&self,
_ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn to_sql(
&self,
_ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
Converts the value of
self into the binary format of the specified
Postgres Type, appending it to out. Read moresourcefn 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
sourcefn encode_format(&self, _ty: &Type) -> Format
fn encode_format(&self, _ty: &Type) -> Format
Specify the encode format
Auto Trait Implementations
impl<T> RefUnwindSafe for AgType<T>where
T: RefUnwindSafe,
impl<T> Send for AgType<T>where
T: Send,
impl<T> Sync for AgType<T>where
T: Sync,
impl<T> Unpin for AgType<T>where
T: Unpin,
impl<T> UnwindSafe for AgType<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> BorrowToSql for Twhere
T: ToSql,
impl<T> BorrowToSql for Twhere
T: ToSql,
sourcefn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
Returns a reference to
self as a ToSql trait object.