Enum pliantdb_core::networking::DatabaseRequest [−][src]
pub enum DatabaseRequest {
Show variants
Get {
collection: CollectionName,
id: u64,
},
GetMultiple {
collection: CollectionName,
ids: Vec<u64>,
},
Query {
view: ViewName,
key: Option<QueryKey<Vec<u8>>>,
access_policy: AccessPolicy,
with_docs: bool,
},
Reduce {
view: ViewName,
key: Option<QueryKey<Vec<u8>>>,
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>,
},
PublishToAll {
topics: Vec<String>,
payload: Vec<u8>,
},
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
Retrieve a single document.
Show fields
Fields of Get
Retrieve multiple documents.
Show fields
Fields of GetMultiple
Queries a view.
Show fields
Fields of Query
view: ViewNameThe name of the view.
key: Option<QueryKey<Vec<u8>>>The filter for the view.
access_policy: AccessPolicyThe access policy for the query.
with_docs: boolIf true, DatabaseResponse::ViewMappingsWithDocs will be
returned. If false, DatabaseResponse::ViewMappings will be
returned.
Reduces a view.
Show fields
Fields of Reduce
view: ViewNameThe name of the view.
key: Option<QueryKey<Vec<u8>>>The filter for the view.
access_policy: AccessPolicyThe access policy for the query.
grouped: boolWhether to return a single value or values grouped by unique key. If
true, DatabaseResponse::ViewGroupedReduction will be returned.
If false, DatabaseResponse::ViewReduction is returned.
Applies a transaction.
Show fields
Fields of ApplyTransaction
transaction: Transaction<'static>The trasnaction to apply.
Lists executed transactions.
Show fields
Queries the last transaction id.
Creates a PubSub Subscriber
Publishes payload to all subscribers of topic.
Show fields
Publishes payload to all subscribers of all topics.
Show fields
Subscribes subscriber_id to messages for topic.
Show fields
Fields of SubscribeTo
Unsubscribes subscriber_id from messages for topic.
Show fields
Fields of UnsubscribeFrom
Unregisters the subscriber.
Show fields
Fields of UnregisterSubscriber
subscriber_id: u64The id of the Subscriber.
ExecuteKeyOperation(KeyOperation)Excutes a key-value store operation.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for DatabaseRequestimpl Send for DatabaseRequestimpl Sync for DatabaseRequestimpl Unpin for DatabaseRequestimpl UnwindSafe for DatabaseRequestBlanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = TShould always be Self