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

pub enum DatabaseRequest {
Show variants Get { collection: CollectionName, id: u64, }, GetMultiple { collection: CollectionName, ids: Vec<u64, Global>, }, Query { view: ViewName, key: Option<QueryKey<Vec<u8, Global>>>, access_policy: AccessPolicy, with_docs: bool, }, Reduce { view: ViewName, 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, CreateSubscriber, Publish { topic: String, payload: Vec<u8, Global>, }, PublishToAll { topics: Vec<String, Global>, payload: Vec<u8, Global>, }, SubscribeTo { subscriber_id: u64, topic: String, }, UnsubscribeFrom { subscriber_id: u64, topic: String, }, UnregisterSubscriber { subscriber_id: u64, }, ExecuteKeyOperation(KeyOperation),
}
Expand description

A database-related request.

Variants

Get

Retrieve a single document.

Show fields

Fields of Get

collection: CollectionName

The collection of the document.

id: u64

The id of the document.

GetMultiple

Retrieve multiple documents.

Show fields

Fields of GetMultiple

collection: CollectionName

The collection of the documents.

ids: Vec<u64, Global>

The ids of the documents.

Query

Queries a view.

Show fields

Fields of Query

view: ViewName

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.

Show fields

Fields of Reduce

view: ViewName

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.

Show fields

Fields of ApplyTransaction

transaction: Transaction<'static>

The trasnaction to apply.

ListExecutedTransactions

Lists executed transactions.

Show fields

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.

CreateSubscriber

Creates a PubSub Subscriber

Publish

Publishes payload to all subscribers of topic.

Show fields

Fields of Publish

topic: String

The topics to publish to.

payload: Vec<u8, Global>

The payload to publish.

PublishToAll

Publishes payload to all subscribers of all topics.

Show fields

Fields of PublishToAll

topics: Vec<String, Global>

The topics to publish to.

payload: Vec<u8, Global>

The payload to publish.

SubscribeTo

Subscribes subscriber_id to messages for topic.

Show fields

Fields of SubscribeTo

subscriber_id: u64

The id of the Subscriber.

topic: String

The topic to subscribe to.

UnsubscribeFrom

Unsubscribes subscriber_id from messages for topic.

Show fields

Fields of UnsubscribeFrom

subscriber_id: u64

The id of the Subscriber.

topic: String

The topic to unsubscribe from.

UnregisterSubscriber

Unregisters the subscriber.

Show fields

Fields of UnregisterSubscriber

subscriber_id: u64

The id of the Subscriber.

ExecuteKeyOperation(KeyOperation)

Excutes a key-value store operation.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.