[−][src]Struct diesel_json::Json
Wrapper type that implements Json data handling for postgres diesel connection
Use as wrapper for fields that are stored in Jsonb format
ⓘ
#[derive(serde::Serialize, serde::Deserialize)] pub struct ComplexStruct { // ... } #[derive(serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Insertable)] pub struct ExampleTable { // Field that will be stored in Json, Jsonb format pub jsonb_field: diesel_json::Json<ComplexStruct>, }
Implementations
impl<T> Json<T>
[src]
Trait Implementations
impl<'expr, T: Sized> AsExpression<Jsonb> for &'expr Json<T>
[src]
type Expression = Bound<Jsonb, Self>
The expression being returned
pub fn as_expression(self) -> Self::Expression
[src]
impl<T: Sized> AsExpression<Jsonb> for Json<T>
[src]
type Expression = Bound<Jsonb, Self>
The expression being returned
pub fn as_expression(self) -> Self::Expression
[src]
impl<'expr, T: Sized> AsExpression<Nullable<Jsonb>> for &'expr Json<T>
[src]
type Expression = Bound<Nullable<Jsonb>, Self>
The expression being returned
pub fn as_expression(self) -> Self::Expression
[src]
impl<T: Sized> AsExpression<Nullable<Jsonb>> for Json<T>
[src]
type Expression = Bound<Nullable<Jsonb>, Self>
The expression being returned
pub fn as_expression(self) -> Self::Expression
[src]
impl<T> AsMut<T> for Json<T>
[src]
impl<T> AsRef<T> for Json<T>
[src]
impl<T: Clone + Sized> Clone for Json<T>
[src]
impl<T: Debug + Sized> Debug for Json<T>
[src]
impl<T> Deref for Json<T>
[src]
impl<T> DerefMut for Json<T>
[src]
impl<'de, T: Sized> Deserialize<'de> for Json<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T> FromSql<Jsonb, Pg> for Json<T> where
T: Debug + DeserializeOwned,
[src]
T: Debug + DeserializeOwned,
impl<T: Sized, __ST, __DB> FromSqlRow<__ST, __DB> for Json<T> where
__DB: Backend,
Self: FromSql<__ST, __DB>,
[src]
__DB: Backend,
Self: FromSql<__ST, __DB>,
pub fn build_from_row<R: Row<__DB>>(row: &mut R) -> Result<Self>
[src]
pub const FIELDS_NEEDED: usize
[src]
impl<T: Sized, __ST, __DB> Queryable<__ST, __DB> for Json<T> where
__DB: Backend,
Self: FromSql<__ST, __DB>,
[src]
__DB: Backend,
Self: FromSql<__ST, __DB>,
type Row = Self
The Rust type you'd like to map from. Read more
pub fn build(row: Self::Row) -> Self
[src]
impl<T: Sized> Serialize for Json<T> where
T: Serialize,
[src]
T: Serialize,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<T> ToSql<Jsonb, Pg> for Json<T> where
T: Debug + Serialize,
[src]
T: Debug + Serialize,
impl<T: Sized, __DB> ToSql<Nullable<Jsonb>, __DB> for Json<T> where
__DB: Backend,
Self: ToSql<Jsonb, __DB>,
[src]
__DB: Backend,
Self: ToSql<Jsonb, __DB>,
Auto Trait Implementations
impl<T> RefUnwindSafe for Json<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Json<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Json<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Json<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Json<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoSql for T
[src]
pub fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]
Self: AsExpression<T>,
pub fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,