[][src]Struct tendermint_rpc::query::Query

pub struct Query { /* fields omitted */ }

A structured query for use in interacting with the Tendermint RPC event subscription system.

Allows for compile-time validation of queries.

See the subscribe endpoint documentation for more details.

Examples

use tendermint_rpc::query::{Query, EventType};

let query = Query::from(EventType::NewBlock);
assert_eq!("tm.event = 'NewBlock'", query.to_string());

let query = Query::from(EventType::Tx).and_eq("tx.hash", "XYZ");
assert_eq!("tm.event = 'Tx' AND tx.hash = 'XYZ'", query.to_string());

let query = Query::from(EventType::Tx).and_gte("tx.height", 100_i64);
assert_eq!("tm.event = 'Tx' AND tx.height >= 100", query.to_string());

Implementations

impl Query[src]

pub fn eq(key: impl ToString, value: impl Into<Operand>) -> Self[src]

Query constructor testing whether <key> = <value>

pub fn lt(key: impl ToString, value: impl Into<Operand>) -> Self[src]

Query constructor testing whether <key> < <value>

pub fn lte(key: impl ToString, value: impl Into<Operand>) -> Self[src]

Query constructor testing whether <key> <= <value>

pub fn gt(key: impl ToString, value: impl Into<Operand>) -> Self[src]

Query constructor testing whether <key> > <value>

pub fn gte(key: impl ToString, value: impl Into<Operand>) -> Self[src]

Query constructor testing whether <key> >= <value>

pub fn contains(key: impl ToString, value: impl ToString) -> Self[src]

Query constructor testing whether <key> CONTAINS <value> (assuming key contains a string, this tests whether value is a sub-string within it).

pub fn exists(key: impl ToString) -> Self[src]

Query constructor testing whether <key> EXISTS.

pub fn and_eq(self, key: impl ToString, value: impl Into<Operand>) -> Self[src]

Add the condition <key> = <value> to the query.

pub fn and_lt(self, key: impl ToString, value: impl Into<Operand>) -> Self[src]

Add the condition <key> < <value> to the query.

pub fn and_lte(self, key: impl ToString, value: impl Into<Operand>) -> Self[src]

Add the condition <key> <= <value> to the query.

pub fn and_gt(self, key: impl ToString, value: impl Into<Operand>) -> Self[src]

Add the condition <key> > <value> to the query.

pub fn and_gte(self, key: impl ToString, value: impl Into<Operand>) -> Self[src]

Add the condition <key> >= <value> to the query.

pub fn and_contains(self, key: impl ToString, value: impl ToString) -> Self[src]

Add the condition <key> CONTAINS <value> to the query.

pub fn and_exists(self, key: impl ToString) -> Self[src]

Add the condition <key> EXISTS to the query.

Trait Implementations

impl Clone for Query[src]

impl Debug for Query[src]

impl Default for Query[src]

fn default() -> Self[src]

An empty query matches any set of events. See these docs.

impl Display for Query[src]

impl From<EventType> for Query[src]

impl PartialEq<Query> for Query[src]

impl StructuralPartialEq for Query[src]

Auto Trait Implementations

impl RefUnwindSafe for Query

impl Send for Query

impl Sync for Query

impl Unpin for Query

impl UnwindSafe for Query

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,