Skip to main content

JsonPath

Struct JsonPath 

Source
pub struct JsonPath<'a, 'q> { /* private fields */ }
Expand description

A value inside a json column in a where_expr. Its JSON type isn’t known, so it compares with any Value: one of another type never equals it. Comparing with null uses IS.

Implementations§

Source§

impl JsonPath<'_, '_>

Source

pub fn cmp(&self, op: SimpleOperator, value: Value) -> Condition

The value at the path compares to value by op.

Source

pub fn cmp_param( &self, op: SimpleOperator, param: &StaticParameter, ) -> Condition

The value at the path compares to a value of the context by op.

Source

pub fn eq(&self, value: Value) -> Condition

The value at the path equals value (IS for null).

Source

pub fn ne(&self, value: Value) -> Condition

The value at the path differs from value (IS NOT for null).

Source

pub fn lt(&self, value: Value) -> Condition

The value at the path is less than value.

Source

pub fn le(&self, value: Value) -> Condition

The value at the path is at most value.

Source

pub fn gt(&self, value: Value) -> Condition

The value at the path is greater than value.

Source

pub fn ge(&self, value: Value) -> Condition

The value at the path is at least value.

Source

pub fn is(&self, value: Value) -> Condition

The value at the path IS value.

Source

pub fn is_not(&self, value: Value) -> Condition

The value at the path IS NOT value.

Source

pub fn is_in(&self, values: Vec<Value>) -> Condition

values must be of one JSON type.

Source

pub fn not_in(&self, values: Vec<Value>) -> Condition

The value at the path is none of values.

Source

pub fn like(&self, pattern: &str) -> Condition

The value at the path matches the LIKE pattern.

Source

pub fn not_like(&self, pattern: &str) -> Condition

The value at the path doesn’t match the LIKE pattern.

Source

pub fn ilike(&self, pattern: &str) -> Condition

The value at the path matches the pattern ignoring case (ILIKE).

Source

pub fn not_ilike(&self, pattern: &str) -> Condition

The value at the path doesn’t match the pattern ignoring case.

Auto Trait Implementations§

§

impl<'a, 'q> !RefUnwindSafe for JsonPath<'a, 'q>

§

impl<'a, 'q> !Send for JsonPath<'a, 'q>

§

impl<'a, 'q> !Sync for JsonPath<'a, 'q>

§

impl<'a, 'q> !UnwindSafe for JsonPath<'a, 'q>

§

impl<'a, 'q> Forget for JsonPath<'a, 'q>

§

impl<'a, 'q> Freeze for JsonPath<'a, 'q>

§

impl<'a, 'q> Move for JsonPath<'a, 'q>

§

impl<'a, 'q> Unpin for JsonPath<'a, 'q>

§

impl<'a, 'q> UnsafeUnpin for JsonPath<'a, 'q>

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<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<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.