Enum bonsaidb_core::networking::DatabaseRequest
source · [−]pub enum DatabaseRequest {
Show 19 variants
Get {
collection: CollectionName,
id: DocumentId,
},
GetMultiple {
collection: CollectionName,
ids: Vec<DocumentId>,
},
List {
collection: CollectionName,
ids: Range<DocumentId>,
order: Sort,
limit: Option<usize>,
},
Query {
view: ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<usize>,
access_policy: AccessPolicy,
with_docs: bool,
},
Reduce {
view: ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy,
grouped: bool,
},
DeleteDocs {
view: ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy,
},
ApplyTransaction {
transaction: Transaction,
},
ListExecutedTransactions {
starting_id: Option<u64>,
result_limit: Option<usize>,
},
LastTransactionId,
CreateSubscriber,
Publish {
topic: String,
payload: Bytes,
},
PublishToAll {
topics: Vec<String>,
payload: Bytes,
},
SubscribeTo {
subscriber_id: u64,
topic: String,
},
UnsubscribeFrom {
subscriber_id: u64,
topic: String,
},
UnregisterSubscriber {
subscriber_id: u64,
},
ExecuteKeyOperation(KeyOperation),
CompactCollection {
name: CollectionName,
},
CompactKeyValueStore,
Compact,
}Expand description
A database-related request.
Variants
Get
Fields
collection: CollectionNameThe collection of the document.
id: DocumentIdThe id of the document.
Retrieve a single document.
GetMultiple
Fields
collection: CollectionNameThe collection of the documents.
ids: Vec<DocumentId>The ids of the documents.
Retrieve multiple documents.
List
Fields
collection: CollectionNameThe collection of the documents.
ids: Range<DocumentId>The range of ids to list.
order: SortThe order for the query into the collection.
Retrieve multiple documents.
Query
Fields
view: ViewNameThe name of the view.
order: SortThe order for the query into 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.
Queries a view.
Reduce
Fields
view: ViewNameThe name of 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.
Reduces a view.
DeleteDocs
Fields
view: ViewNameThe name of the view.
access_policy: AccessPolicyThe access policy for the query.
Deletes the associated documents resulting from the view query.
ApplyTransaction
Fields
transaction: TransactionThe trasnaction to apply.
Applies a transaction.
ListExecutedTransactions
Fields
Lists executed transactions.
LastTransactionId
Queries the last transaction id.
CreateSubscriber
Creates a PubSub Subscriber
Publish
Publishes payload to all subscribers of topic.
PublishToAll
Publishes payload to all subscribers of all topics.
SubscribeTo
Subscribes subscriber_id to messages for topic.
UnsubscribeFrom
Unsubscribes subscriber_id from messages for topic.
UnregisterSubscriber
Fields
subscriber_id: u64The id of the Subscriber.
Unregisters the subscriber.
ExecuteKeyOperation(KeyOperation)
Excutes a key-value store operation.
CompactCollection
Fields
name: CollectionNameThe name of the collection to compact.
Compacts the collection.
CompactKeyValueStore
Compacts the key-value store.
Compact
Compacts the entire database.
Trait Implementations
sourceimpl Clone for DatabaseRequest
impl Clone for DatabaseRequest
sourcefn clone(&self) -> DatabaseRequest
fn clone(&self) -> DatabaseRequest
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for DatabaseRequest
impl Debug for DatabaseRequest
sourceimpl<'de> Deserialize<'de> for DatabaseRequest
impl<'de> Deserialize<'de> for DatabaseRequest
sourcefn 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
sourceimpl Serialize for DatabaseRequest
impl Serialize for DatabaseRequest
Auto Trait Implementations
impl RefUnwindSafe for DatabaseRequest
impl Send for DatabaseRequest
impl Sync for DatabaseRequest
impl Unpin for DatabaseRequest
impl UnwindSafe for DatabaseRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more