Struct bonsaidb_client::RemoteDatabase
source · [−]Expand description
A database on a remote server.
Implementations
Methods from Deref<Target = Client<A>>
Sends an api request.
Returns the current effective permissions for the client. Returns None if unauthenticated.
Trait Implementations
Retrieves a stored document from Collection C identified by id.
fn get_multiple<'life0, 'life1, 'async_trait, C: Collection>(
&'life0 self,
ids: &'life1 [u64]
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_multiple<'life0, 'life1, 'async_trait, C: Collection>(
&'life0 self,
ids: &'life1 [u64]
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieves all documents matching ids. Documents that are not found
are not returned, but no error will be generated. Read more
fn list<'life0, 'async_trait, C: Collection, R: Into<Range<u64>> + Send>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<usize>
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn list<'life0, 'async_trait, C: Collection, R: Into<Range<u64>> + Send>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<usize>
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Retrieves all documents within the range of ids. Documents that are
not found are not returned, but no error will be generated. To retrieve
all documents, pass in .. for ids. Read more
fn query<'life0, 'async_trait, V: SerializedView>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
order: Sort,
limit: Option<usize>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<Map<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn query<'life0, 'async_trait, V: SerializedView>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
order: Sort,
limit: Option<usize>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<Map<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Queries for view entries matching View.
fn query_with_docs<'life0, 'async_trait, V: SerializedView>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
order: Sort,
limit: Option<usize>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<OwnedDocument, V>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn query_with_docs<'life0, 'async_trait, V: SerializedView>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
order: Sort,
limit: Option<usize>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<OwnedDocument, V>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Queries for view entries matching View with their source documents.
Reduces the view entries matching View.
fn reduce_grouped<'life0, 'async_trait, V: SerializedView>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedValue<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn reduce_grouped<'life0, 'async_trait, V: SerializedView>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedValue<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn delete_docs<'life0, 'async_trait, V: SerializedView>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn delete_docs<'life0, 'async_trait, V: SerializedView>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Deletes all of the documents associated with this view.
fn apply_transaction<'life0, 'async_trait>(
&'life0 self,
transaction: Transaction
) -> Pin<Box<dyn Future<Output = Result<Vec<OperationResult>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn apply_transaction<'life0, 'async_trait>(
&'life0 self,
transaction: Transaction
) -> Pin<Box<dyn Future<Output = Result<Vec<OperationResult>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Applies a Transaction to the schema::Schema. If any operation in the
Transaction fails, none of the operations will be applied to the
schema::Schema. Read more
Lists executed Transactions from this schema::Schema. By default, a maximum of
1000 entries will be returned, but that limit can be overridden by
setting result_limit. A hard limit of 100,000 results will be
returned. To begin listing after another known transaction_id, pass
transaction_id + 1 into starting_id. Read more
Fetches the last transaction id that has been committed, if any.
fn compact_collection<'life0, 'async_trait, C: Collection>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn compact_collection<'life0, 'async_trait, C: Collection>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Compacts the collection to reclaim unused disk space. Read more
Compacts the entire database to reclaim unused disk space. Read more
Compacts the key value store to reclaim unused disk space. Read more
Accesses a collection for the connected schema::Schema.
Inserts a newly created document into the connected schema::Schema
for the Collection C. If id is None a unique id will be
generated. If an id is provided and a document already exists with that
id, a conflict error will be returned. Read more
fn update<'a, 'life0, 'life1, 'async_trait, C, D>(
&'life0 self,
doc: &'life1 mut D
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
C: Collection + 'async_trait,
D: Document<'a> + Send + Sync + 'async_trait,
Self: 'async_trait,
fn update<'a, 'life0, 'life1, 'async_trait, C, D>(
&'life0 self,
doc: &'life1 mut D
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
C: Collection + 'async_trait,
D: Document<'a> + Send + Sync + 'async_trait,
Self: 'async_trait,
Updates an existing document in the connected schema::Schema for the
Collection C. Upon success, doc.revision will be updated with
the new revision. Read more
fn delete<'life0, 'life1, 'async_trait, C, H>(
&'life0 self,
doc: &'life1 H
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
C: Collection + 'async_trait,
H: AsRef<Header> + Send + Sync + 'async_trait,
Self: 'async_trait,
fn delete<'life0, 'life1, 'async_trait, C, H>(
&'life0 self,
doc: &'life1 H
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
C: Collection + 'async_trait,
H: AsRef<Header> + Send + Sync + 'async_trait,
Self: 'async_trait,
Removes a Document from the database.
Initializes View for schema::View V.
fn query_with_collection_docs<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
order: Sort,
limit: Option<usize>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<CollectionDocument<<V as View>::Collection>, V>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: SerializedView + 'async_trait,
Self: 'async_trait,
<V as View>::Collection: SerializedCollection,
<<V as View>::Collection as SerializedCollection>::Contents: Debug,
fn query_with_collection_docs<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
order: Sort,
limit: Option<usize>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<CollectionDocument<<V as View>::Collection>, V>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: SerializedView + 'async_trait,
Self: 'async_trait,
<V as View>::Collection: SerializedCollection,
<<V as View>::Collection as SerializedCollection>::Contents: Debug,
Queries for view entries matching View with their source documents, deserialized.
fn execute_key_operation<'life0, 'async_trait>(
&'life0 self,
op: KeyOperation
) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn execute_key_operation<'life0, 'async_trait>(
&'life0 self,
op: KeyOperation
) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Executes a single KeyOperation.
Sets key to value. This function returns a builder that is also a
Future. Awaiting the builder will execute Command::Set with the options
given. Read more
Sets key to bytes. This function returns a builder that is also
a Future. Awaiting the builder will execute Command::Set with
the options given. Read more
Sets key to value. This stores the value as a Numeric,
enabling atomic math operations to be performed on this key. This
function returns a builder that is also a Future. Awaiting the
builder will execute Command::Set with the options given. Read more
Increments key by value. The value stored must be a Numeric,
otherwise an error will be returned. The result of the increment
will be the value’s type. For example, if the stored value is
currently a u64, but value is a f64, the current value will be
converted to an f64, and the stored value will be an f64. Read more
Decrements key by value. The value stored must be a Numeric,
otherwise an error will be returned. The result of the decrement
will be the value’s type. For example, if the stored value is
currently a u64, but value is a f64, the current value will be
converted to an f64, and the stored value will be an f64. Read more
Gets the value stored at key. This function returns a builder that is also a
Future. Awaiting the builder will execute Command::Get with the options
given. Read more
Deletes the value stored at key.
The current namespace.
Access this Key-Value store within a namespace. When using the returned
Namespaced instance, all keys specified will be separated into their
own storage designated by namespace. Read more
type Subscriber = RemoteSubscriber<A>
type Subscriber = RemoteSubscriber<A>
The Subscriber type for this PubSub connection.
fn create_subscriber<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn create_subscriber<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create a new Subscriber for this relay.
fn publish<'life0, 'life1, 'async_trait, S: Into<String> + Send, P: Serialize + Sync>(
&'life0 self,
topic: S,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
S: 'async_trait,
P: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn publish<'life0, 'life1, 'async_trait, S: Into<String> + Send, P: Serialize + Sync>(
&'life0 self,
topic: S,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
S: 'async_trait,
P: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Publishes a payload to all subscribers of topic.
Publishes a payload to all subscribers of all topics.
Auto Trait Implementations
impl<A = ()> !RefUnwindSafe for RemoteDatabase<A>
impl<A> Send for RemoteDatabase<A>
impl<A> Sync for RemoteDatabase<A>
impl<A> Unpin for RemoteDatabase<A>
impl<A = ()> !UnwindSafe for RemoteDatabase<A>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more