Enum pliantdb_local::core::networking::DatabaseRequest[][src]

pub enum DatabaseRequest {
    Get {
        collection: Id,
        id: u64,
    },
    GetMultiple {
        collection: Id,
        ids: Vec<u64, Global>,
    },
    Query {
        view: Cow<'static, str>,
        key: Option<QueryKey<Vec<u8, Global>>>,
        access_policy: AccessPolicy,
        with_docs: bool,
    },
    Reduce {
        view: Cow<'static, str>,
        key: Option<QueryKey<Vec<u8, Global>>>,
        access_policy: AccessPolicy,
        grouped: bool,
    },
    ApplyTransaction {
        transaction: Transaction<'static>,
    },
    ListExecutedTransactions {
        starting_id: Option<u64>,
        result_limit: Option<usize>,
    },
    LastTransactionId,
}

A database-related request.

Variants

Get

Retrieve a single document.

Fields of Get

collection: Id

The collection of the document.

id: u64

The id of the document.

GetMultiple

Retrieve multiple documents.

Fields of GetMultiple

collection: Id

The collection of the documents.

ids: Vec<u64, Global>

The ids of the documents.

Query

Queries a view.

Fields of Query

view: Cow<'static, str>

The name of the view.

key: Option<QueryKey<Vec<u8, Global>>>

The filter for the view.

access_policy: AccessPolicy

The access policy for the query.

with_docs: bool

If true, DatabaseResponse::ViewMappingsWithDocs will be returned. If false, DatabaseResponse::ViewMappings will be returned.

Reduce

Reduces a view.

Fields of Reduce

view: Cow<'static, str>

The name of the view.

key: Option<QueryKey<Vec<u8, Global>>>

The filter for the view.

access_policy: AccessPolicy

The access policy for the query.

grouped: bool

Whether to return a single value or values grouped by unique key. If true, DatabaseResponse::ViewGroupedReduction will be returned. If false, DatabaseResponse::ViewReduction is returned.

ApplyTransaction

Applies a transaction.

Fields of ApplyTransaction

transaction: Transaction<'static>

The trasnaction to apply.

ListExecutedTransactions

Lists executed transactions.

Fields of ListExecutedTransactions

starting_id: Option<u64>

The starting transaction id.

result_limit: Option<usize>

The maximum number of results.

LastTransactionId

Queries the last transaction id.

Trait Implementations

impl Clone for DatabaseRequest[src]

impl Debug for DatabaseRequest[src]

impl<'de> Deserialize<'de> for DatabaseRequest[src]

impl Serialize for DatabaseRequest[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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>,