Skip to main content

Jsonb

Struct Jsonb 

Source
pub struct Jsonb<T>(pub T);
Available on crate features jsonb and serde only.
Expand description

A value which is stored in SQLite serialized as JSONB.

§⚠️ Warning

Jsonb is implemented with serde_sqlite_jsonb, which provides its own implementation of the SQLite binary JSON format. This implementation may contain bugs not present in SQLite.

For a safer alternative, use Json instead, and convert to and from JSONB in your queries using the jsonb() and json() SQL functions.

Tuple Fields§

§0: T

Trait Implementations§

Source§

impl<'b, T> Bind<'b> for Jsonb<T>
where T: Serialize,

Source§

type Value = Vec<u8>

A type directly handled by the SQLite parameter binding API.
Source§

fn into_bind_value(self) -> Result<Self::Value>

Convert self into a directly bindable type. Read more
Source§

impl<'r, T> Fetch<'r> for Jsonb<T>
where T: Deserialize<'r>,

Source§

type Value = Borrowed<'r, [u8]>

Source§

fn from_value(value: Self::Value) -> Result<Self>

Source§

fn fetch_column<'c>( statement: &'r Statement<'c>, column: ColumnIndex, ) -> Result<Self>

Source§

fn fetch_value<'c>(value: &'r ValueRef<'c>) -> Result<Self>

Available on crate features functions or value only.

Auto Trait Implementations§

§

impl<T> Freeze for Jsonb<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Jsonb<T>
where T: RefUnwindSafe,

§

impl<T> Send for Jsonb<T>
where T: Send,

§

impl<T> Sync for Jsonb<T>
where T: Sync,

§

impl<T> Unpin for Jsonb<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Jsonb<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Jsonb<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<'r, T> ColumnIndexes for T
where T: Fetch<'r>,

Source§

type Indexes = ()

Source§

fn resolve<'c>( _statement: &Statement<'c>, ) -> Option<<T as ColumnIndexes>::Indexes>

Source§

impl<'r, T> Columns<'r> for T
where T: Fetch<'r>,

Source§

fn fetch<'c>( statement: &'r Statement<'c>, _indexes: <T as ColumnIndexes>::Indexes, ) -> Result<T, Error>
where 'c: 'r,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'s, T> Parameters<'s> for T
where T: Bind<'s>,

Source§

type Indexes = ()

Source§

fn resolve<'c>( _statement: &Statement<'c>, ) -> Option<<T as Parameters<'s>>::Indexes>

Source§

fn bind<'c>( self, binding: &mut Binding<'c, 's>, _indexes: <T as Parameters<'s>>::Indexes, ) -> Result<(), Error>
where 'c: 's,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.