Struct bonsaidb_client::RemoteDatabase
source · [−]pub struct RemoteDatabase { /* private fields */ }Expand description
A database on a remote server.
Implementations
sourceimpl RemoteDatabase
impl RemoteDatabase
Methods from Deref<Target = Client>
sourcepub async fn send_api_request_async<Api: Api>(
&self,
request: &Api
) -> Result<Api::Response, ApiError<Api::Error>>
pub async fn send_api_request_async<Api: Api>(
&self,
request: &Api
) -> Result<Api::Response, ApiError<Api::Error>>
Sends an api request.
sourcepub fn invoke_api_request<Api: Api>(&self, request: &Api) -> Result<(), Error>
pub fn invoke_api_request<Api: Api>(&self, request: &Api) -> Result<(), Error>
Sends an api request without waiting for a result. The response from
the server will be ignored.
sourcepub fn send_api_request<Api: Api>(
&self,
request: &Api
) -> Result<Api::Response, ApiError<Api::Error>>
pub fn send_api_request<Api: Api>(
&self,
request: &Api
) -> Result<Api::Response, ApiError<Api::Error>>
Sends an api request.
sourcepub async fn effective_permissions(&self) -> Option<Permissions>
pub async fn effective_permissions(&self) -> Option<Permissions>
Returns the current effective permissions for the client. Returns None if unauthenticated.
Trait Implementations
sourceimpl AsyncConnection for RemoteDatabase
impl AsyncConnection for RemoteDatabase
type Storage = Client
type Storage = Client
The AsyncStorageConnection type that is paired with this type.
sourcefn storage(&self) -> Self::Storage
fn storage(&self) -> Self::Storage
Returns the StorageConnection implementor that this database belongs
to. Read more
sourcefn list_executed_transactions<'life0, 'async_trait>(
&'life0 self,
starting_id: Option<u64>,
result_limit: Option<u32>
) -> Pin<Box<dyn Future<Output = Result<Vec<Executed>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn list_executed_transactions<'life0, 'async_trait>(
&'life0 self,
starting_id: Option<u64>,
result_limit: Option<u32>
) -> Pin<Box<dyn Future<Output = Result<Vec<Executed>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Lists executed transactions from this 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
sourcefn last_transaction_id<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn last_transaction_id<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Fetches the last transaction id that has been committed, if any.
sourcefn compact<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn compact<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Compacts the entire database to reclaim unused disk space. Read more
sourcefn compact_key_value_store<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn compact_key_value_store<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Compacts the key value store to reclaim unused disk space. Read more
sourcefn collection<C>(&self) -> AsyncCollection<'_, Self, C> where
C: Collection,
fn collection<C>(&self) -> AsyncCollection<'_, Self, C> where
C: Collection,
Accesses a collection for the connected Schema.
sourcefn view<V>(&self) -> AsyncView<'_, Self, V> where
V: SerializedView,
fn view<V>(&self) -> AsyncView<'_, Self, V> where
V: SerializedView,
Initializes View for schema::View V.
sourceimpl AsyncKeyValue for RemoteDatabase
impl AsyncKeyValue for RemoteDatabase
sourcefn 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.
sourcefn set_key<S, V>(&'a self, key: S, value: &'a V) -> AsyncBuilder<'a, Self, V> where
S: Into<String>,
V: Serialize + Send + Sync,
fn set_key<S, V>(&'a self, key: S, value: &'a V) -> AsyncBuilder<'a, Self, V> where
S: Into<String>,
V: Serialize + Send + Sync,
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
sourcefn set_binary_key<S>(
&'a self,
key: S,
bytes: &'a [u8]
) -> AsyncBuilder<'a, Self, ()> where
S: Into<String>,
fn set_binary_key<S>(
&'a self,
key: S,
bytes: &'a [u8]
) -> AsyncBuilder<'a, Self, ()> where
S: Into<String>,
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
sourcefn set_numeric_key<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, ()> where
S: Into<String>,
V: Into<Numeric>,
fn set_numeric_key<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, ()> where
S: Into<String>,
V: Into<Numeric>,
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
sourcefn increment_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V> where
S: Into<String> + Send + Sync,
V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,
fn increment_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V> where
S: Into<String> + Send + Sync,
V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,
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
sourcefn decrement_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V> where
S: Into<String> + Send + Sync,
V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,
fn decrement_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V> where
S: Into<String> + Send + Sync,
V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,
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
sourcefn get_key<S>(&self, key: S) -> AsyncBuilder<'_, Self> where
S: Into<String>,
fn get_key<S>(&self, key: S) -> AsyncBuilder<'_, Self> where
S: Into<String>,
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
sourcefn delete_key<'life0, 'async_trait, S>(
&'life0 self,
key: S
) -> Pin<Box<dyn Future<Output = Result<KeyStatus, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
S: 'async_trait + Into<String> + Send,
Self: 'async_trait,
fn delete_key<'life0, 'async_trait, S>(
&'life0 self,
key: S
) -> Pin<Box<dyn Future<Output = Result<KeyStatus, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
S: 'async_trait + Into<String> + Send,
Self: 'async_trait,
Deletes the value stored at key.
sourcefn key_namespace(&self) -> Option<&str>
fn key_namespace(&self) -> Option<&str>
The current namespace.
sourcefn with_key_namespace(&self, namespace: &str) -> Namespaced<'_, Self>
fn with_key_namespace(&self, namespace: &str) -> Namespaced<'_, Self>
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
sourceimpl AsyncLowLevelConnection for RemoteDatabase
impl AsyncLowLevelConnection for RemoteDatabase
sourcefn 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. If any
operation in the Transaction fails, none of the operations will be
applied to the Schema. Read more
sourcefn get_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
id: DocumentId,
collection: &'life1 CollectionName
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
id: DocumentId,
collection: &'life1 CollectionName
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieves the document with id stored within the named collection. Read more
sourcefn get_multiple_from_collection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [DocumentId],
collection: &'life2 CollectionName
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn get_multiple_from_collection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [DocumentId],
collection: &'life2 CollectionName
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Retrieves all documents matching ids from the named collection.
Documents that are not found are not returned, but no error will be
generated. Read more
sourcefn list_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &'life1 CollectionName
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn list_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &'life1 CollectionName
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieves all documents within the range of ids from the named
collection. To retrieve all documents, pass in .. for ids. Read more
sourcefn list_headers_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &'life1 CollectionName
) -> Pin<Box<dyn Future<Output = Result<Vec<Header>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn list_headers_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &'life1 CollectionName
) -> Pin<Box<dyn Future<Output = Result<Vec<Header>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieves all headers within the range of ids from the named
collection. To retrieve all documents, pass in .. for ids. Read more
sourcefn count_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
collection: &'life1 CollectionName
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn count_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
collection: &'life1 CollectionName
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Counts the number of documents within the range of ids from the named
collection. Read more
sourcefn compact_collection_by_name<'life0, 'async_trait>(
&'life0 self,
collection: CollectionName
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn compact_collection_by_name<'life0, 'async_trait>(
&'life0 self,
collection: CollectionName
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Compacts the collection to reclaim unused disk space. Read more
sourcefn query_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<Serialized>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn query_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<Serialized>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Queries for view entries from the named view. Read more
sourcefn query_by_name_with_docs<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<MappedSerializedDocuments, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn query_by_name_with_docs<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<MappedSerializedDocuments, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Queries for view entries from the named view with their source
documents. Read more
sourcefn reduce_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn reduce_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Reduces the view entries from the named view. Read more
sourcefn reduce_grouped_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedSerializedValue>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn reduce_grouped_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedSerializedValue>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Reduces the view entries from the named view, reducing the values by each
unique key. Read more
sourcefn delete_docs_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn delete_docs_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Deletes all source documents for entries that match within the named
view. Read more
sourcefn insert<'life0, 'async_trait, C, PrimaryKey, B>(
&'life0 self,
id: Option<PrimaryKey>,
contents: B
) -> Pin<Box<dyn Future<Output = Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait + Send,
C: 'async_trait + Collection,
B: 'async_trait + Into<Bytes> + Send,
Self: 'async_trait,
fn insert<'life0, 'async_trait, C, PrimaryKey, B>(
&'life0 self,
id: Option<PrimaryKey>,
contents: B
) -> Pin<Box<dyn Future<Output = Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait + Send,
C: 'async_trait + Collection,
B: 'async_trait + Into<Bytes> + Send,
Self: 'async_trait,
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
sourcefn update<'life0, 'life1, 'async_trait, C, D>(
&'life0 self,
doc: &'life1 mut D
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
C: 'async_trait + Collection,
D: 'async_trait + Document<C> + Send + Sync,
Self: 'async_trait,
fn update<'life0, 'life1, 'async_trait, C, D>(
&'life0 self,
doc: &'life1 mut D
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
C: 'async_trait + Collection,
D: 'async_trait + Document<C> + Send + Sync,
Self: 'async_trait,
Updates an existing document in the connected schema::Schema for the
Collection(schema::Collection) C. Upon success, doc.revision
will be updated with the new revision. Read more
sourcefn overwrite<'a, 'life0, 'async_trait, C, PrimaryKey>(
&'life0 self,
id: PrimaryKey,
contents: Vec<u8, Global>
) -> Pin<Box<dyn Future<Output = Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
fn overwrite<'a, 'life0, 'async_trait, C, PrimaryKey>(
&'life0 self,
id: PrimaryKey,
contents: Vec<u8, Global>
) -> Pin<Box<dyn Future<Output = Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
Overwrites an existing document, or inserts a new document. Upon success,
doc.revision will be updated with the new revision information. Read more
sourcefn get<'life0, 'async_trait, C, PrimaryKey>(
&'life0 self,
id: PrimaryKey
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
fn get<'life0, 'async_trait, C, PrimaryKey>(
&'life0 self,
id: PrimaryKey
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
Retrieves a stored document from Collection C identified by id. Read more
sourcefn get_multiple<'life0, 'async_trait, C, PrimaryKey, DocumentIds, I>(
&'life0 self,
ids: DocumentIds
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
DocumentIds: IntoIterator<Item = PrimaryKey, IntoIter = I> + Send + Sync + 'async_trait,
I: Iterator<Item = PrimaryKey> + Send + Sync + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
fn get_multiple<'life0, 'async_trait, C, PrimaryKey, DocumentIds, I>(
&'life0 self,
ids: DocumentIds
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
DocumentIds: IntoIterator<Item = PrimaryKey, IntoIter = I> + Send + Sync + 'async_trait,
I: Iterator<Item = PrimaryKey> + Send + Sync + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + '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
sourcefn list<'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<Range<PrimaryKey>> + Send + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
fn list<'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<Range<PrimaryKey>> + Send + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
Retrieves all documents within the range of ids. To retrieve all
documents, pass in .. for ids. Read more
sourcefn list_headers<'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Pin<Box<dyn Future<Output = Result<Vec<Header, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<Range<PrimaryKey>> + Send + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
fn list_headers<'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Pin<Box<dyn Future<Output = Result<Vec<Header, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<Range<PrimaryKey>> + Send + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
Retrieves all documents within the range of ids. To retrieve all
documents, pass in .. for ids. Read more
sourcefn count<'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<Range<PrimaryKey>> + Send + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
fn count<'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<Range<PrimaryKey>> + Send + 'async_trait,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
Counts the number of documents within the range of ids. Read more
sourcefn 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: 'async_trait + Collection,
H: 'async_trait + HasHeader + Send + Sync,
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: 'async_trait + Collection,
H: 'async_trait + HasHeader + Send + Sync,
Self: 'async_trait,
Removes a Document from the database. Read more
sourcefn query<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<Map<<V as View>::Key, <V as View>::Value>, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn query<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<Map<<V as View>::Key, <V as View>::Value>, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
sourcefn query_with_docs<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<OwnedDocument, V>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn query_with_docs<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<OwnedDocument, V>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
sourcefn query_with_collection_docs<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
order: Sort,
limit: Option<u32>,
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<u32>,
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,
sourcefn reduce<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<<V as View>::Value, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn reduce<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<<V as View>::Value, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
sourcefn reduce_grouped<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedValue<<V as View>::Key, <V as View>::Value>, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn reduce_grouped<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedValue<<V as View>::Key, <V as View>::Value>, Global>, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
sourcefn delete_docs<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn delete_docs<'life0, 'async_trait, V>(
&'life0 self,
key: Option<QueryKey<<V as View>::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
V: 'async_trait + SerializedView,
Self: 'async_trait,
Deletes all of the documents associated with this view. Read more
sourceimpl AsyncPubSub for RemoteDatabase
impl AsyncPubSub for RemoteDatabase
type Subscriber = RemoteSubscriber
type Subscriber = RemoteSubscriber
The Subscriber type for this PubSub connection.
sourcefn 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.
sourcefn publish_bytes<'life0, 'async_trait>(
&'life0 self,
topic: Vec<u8>,
payload: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn publish_bytes<'life0, 'async_trait>(
&'life0 self,
topic: Vec<u8>,
payload: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Publishes a payload to all subscribers of topic.
sourcefn publish_bytes_to_all<'life0, 'async_trait>(
&'life0 self,
topics: impl IntoIterator<Item = Vec<u8>> + Send + 'async_trait,
payload: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn publish_bytes_to_all<'life0, 'async_trait>(
&'life0 self,
topics: impl IntoIterator<Item = Vec<u8>> + Send + 'async_trait,
payload: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Publishes a payload to all subscribers of all topics.
sourcefn publish<'life0, 'life1, 'life2, 'async_trait, Topic, Payload>(
&'life0 self,
topic: &'life1 Topic,
payload: &'life2 Payload
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Topic: 'async_trait + Serialize + Send + Sync,
Payload: 'async_trait + Serialize + Send + Sync,
Self: 'async_trait,
fn publish<'life0, 'life1, 'life2, 'async_trait, Topic, Payload>(
&'life0 self,
topic: &'life1 Topic,
payload: &'life2 Payload
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Topic: 'async_trait + Serialize + Send + Sync,
Payload: 'async_trait + Serialize + Send + Sync,
Self: 'async_trait,
Publishes a payload to all subscribers of topic.
sourcefn publish_to_all<'topics, 'life0, 'life1, 'async_trait, Topics, Topic, Payload>(
&'life0 self,
topics: Topics,
payload: &'life1 Payload
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'topics: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Topics: 'async_trait + 'topics + IntoIterator<Item = &'topics Topic> + Send,
Topic: 'async_trait + 'topics + Serialize + Send,
Payload: 'async_trait + Serialize + Send + Sync,
Self: 'async_trait,
fn publish_to_all<'topics, 'life0, 'life1, 'async_trait, Topics, Topic, Payload>(
&'life0 self,
topics: Topics,
payload: &'life1 Payload
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'topics: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Topics: 'async_trait + 'topics + IntoIterator<Item = &'topics Topic> + Send,
Topic: 'async_trait + 'topics + Serialize + Send,
Payload: 'async_trait + Serialize + Send + Sync,
Self: 'async_trait,
Publishes a payload to all subscribers of all topics.
sourceimpl Clone for RemoteDatabase
impl Clone for RemoteDatabase
sourcefn clone(&self) -> RemoteDatabase
fn clone(&self) -> RemoteDatabase
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 Connection for RemoteDatabase
impl Connection for RemoteDatabase
type Storage = Client
type Storage = Client
The StorageConnection type that is paired with this type.
sourcefn storage(&self) -> Self::Storage
fn storage(&self) -> Self::Storage
Returns the StorageConnection implementor that this database belongs to.
sourcefn list_executed_transactions(
&self,
starting_id: Option<u64>,
result_limit: Option<u32>
) -> Result<Vec<Executed>, Error>
fn list_executed_transactions(
&self,
starting_id: Option<u64>,
result_limit: Option<u32>
) -> Result<Vec<Executed>, Error>
Lists executed transactions from this
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
sourcefn last_transaction_id(&self) -> Result<Option<u64>, Error>
fn last_transaction_id(&self) -> Result<Option<u64>, Error>
Fetches the last transaction id that has been committed, if any.
sourcefn compact(&self) -> Result<(), Error>
fn compact(&self) -> Result<(), Error>
Compacts the entire database to reclaim unused disk space. Read more
sourcefn compact_key_value_store(&self) -> Result<(), Error>
fn compact_key_value_store(&self) -> Result<(), Error>
Compacts the key value store to reclaim unused disk space. Read more
sourcefn collection<C>(&self) -> Collection<'_, Self, C> where
C: Collection,
fn collection<C>(&self) -> Collection<'_, Self, C> where
C: Collection,
Accesses a collection for the connected Schema.
sourcefn view<V>(&self) -> View<'_, Self, V, <V as View>::Key> where
V: SerializedView,
fn view<V>(&self) -> View<'_, Self, V, <V as View>::Key> where
V: SerializedView,
Accesses a schema::View from this connection.
sourcefn compact_collection<C>(&self) -> Result<(), Error> where
C: Collection,
fn compact_collection<C>(&self) -> Result<(), Error> where
C: Collection,
Compacts the collection to reclaim unused disk space. Read more
sourceimpl Debug for RemoteDatabase
impl Debug for RemoteDatabase
sourceimpl Deref for RemoteDatabase
impl Deref for RemoteDatabase
sourceimpl HasSession for RemoteDatabase
impl HasSession for RemoteDatabase
sourceimpl KeyValue for RemoteDatabase
impl KeyValue for RemoteDatabase
sourcefn execute_key_operation(&self, op: KeyOperation) -> Result<Output, Error>
fn execute_key_operation(&self, op: KeyOperation) -> Result<Output, Error>
Executes a single KeyOperation.
sourcefn set_key<S, V>(&'a self, key: S, value: &'a V) -> Builder<'a, Self, V> where
S: Into<String>,
V: Serialize + Send + Sync,
fn set_key<S, V>(&'a self, key: S, value: &'a V) -> Builder<'a, Self, V> where
S: Into<String>,
V: Serialize + Send + Sync,
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
sourcefn set_binary_key<S>(&'a self, key: S, bytes: &'a [u8]) -> Builder<'a, Self, ()> where
S: Into<String>,
fn set_binary_key<S>(&'a self, key: S, bytes: &'a [u8]) -> Builder<'a, Self, ()> where
S: Into<String>,
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
sourcefn set_numeric_key<S, V>(&self, key: S, value: V) -> Builder<'_, Self, ()> where
S: Into<String>,
V: Into<Numeric>,
fn set_numeric_key<S, V>(&self, key: S, value: V) -> Builder<'_, Self, ()> where
S: Into<String>,
V: Into<Numeric>,
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
sourcefn increment_key_by<S, V>(&self, key: S, value: V) -> Builder<'_, Self, V> where
S: Into<String> + Send + Sync,
V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,
fn increment_key_by<S, V>(&self, key: S, value: V) -> Builder<'_, Self, V> where
S: Into<String> + Send + Sync,
V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,
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
sourcefn decrement_key_by<S, V>(&self, key: S, value: V) -> Builder<'_, Self, V> where
S: Into<String> + Send + Sync,
V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,
fn decrement_key_by<S, V>(&self, key: S, value: V) -> Builder<'_, Self, V> where
S: Into<String> + Send + Sync,
V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,
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
sourcefn get_key<S>(&self, key: S) -> Builder<'_, Self> where
S: Into<String>,
fn get_key<S>(&self, key: S) -> Builder<'_, Self> where
S: Into<String>,
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
sourcefn delete_key<S>(&self, key: S) -> Result<KeyStatus, Error> where
S: Into<String> + Send,
fn delete_key<S>(&self, key: S) -> Result<KeyStatus, Error> where
S: Into<String> + Send,
Deletes the value stored at key.
sourcefn key_namespace(&self) -> Option<&str>
fn key_namespace(&self) -> Option<&str>
The current namespace.
sourcefn with_key_namespace(&self, namespace: &str) -> Namespaced<'_, Self>
fn with_key_namespace(&self, namespace: &str) -> Namespaced<'_, Self>
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
sourceimpl LowLevelConnection for RemoteDatabase
impl LowLevelConnection for RemoteDatabase
sourcefn apply_transaction(
&self,
transaction: Transaction
) -> Result<Vec<OperationResult>, Error>
fn apply_transaction(
&self,
transaction: Transaction
) -> Result<Vec<OperationResult>, Error>
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
sourcefn get_from_collection(
&self,
id: DocumentId,
collection: &CollectionName
) -> Result<Option<OwnedDocument>, Error>
fn get_from_collection(
&self,
id: DocumentId,
collection: &CollectionName
) -> Result<Option<OwnedDocument>, Error>
Retrieves the document with id stored within the named collection. Read more
sourcefn get_multiple_from_collection(
&self,
ids: &[DocumentId],
collection: &CollectionName
) -> Result<Vec<OwnedDocument>, Error>
fn get_multiple_from_collection(
&self,
ids: &[DocumentId],
collection: &CollectionName
) -> Result<Vec<OwnedDocument>, Error>
Retrieves all documents matching ids from the named collection.
Documents that are not found are not returned, but no error will be
generated. Read more
sourcefn list_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<OwnedDocument>, Error>
fn list_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<OwnedDocument>, Error>
Retrieves all documents within the range of ids from the named
collection. To retrieve all documents, pass in .. for ids. Read more
sourcefn list_headers_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<Header>, Error>
fn list_headers_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<Header>, Error>
Retrieves all headers within the range of ids from the named
collection. To retrieve all documents, pass in .. for ids. Read more
sourcefn count_from_collection(
&self,
ids: Range<DocumentId>,
collection: &CollectionName
) -> Result<u64, Error>
fn count_from_collection(
&self,
ids: Range<DocumentId>,
collection: &CollectionName
) -> Result<u64, Error>
Counts the number of documents within the range of ids from the named
collection. Read more
sourcefn compact_collection_by_name(
&self,
collection: CollectionName
) -> Result<(), Error>
fn compact_collection_by_name(
&self,
collection: CollectionName
) -> Result<(), Error>
Compacts the collection to reclaim unused disk space. Read more
sourcefn query_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Serialized>, Error>
fn query_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Serialized>, Error>
Queries for view entries from the named view. Read more
sourcefn query_by_name_with_docs(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedSerializedDocuments, Error>
fn query_by_name_with_docs(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedSerializedDocuments, Error>
Queries for view entries from the named view with their source
documents. Read more
sourcefn reduce_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<u8>, Error>
fn reduce_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<u8>, Error>
Reduces the view entries from the named view. Read more
sourcefn reduce_grouped_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedSerializedValue>, Error>
fn reduce_grouped_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedSerializedValue>, Error>
Reduces the view entries from the named view, reducing the values by each
unique key. Read more
sourcefn delete_docs_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<u64, Error>
fn delete_docs_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<u64, Error>
Deletes all source documents for entries that match within the named
view. Read more
sourcefn insert<C, PrimaryKey, B>(
&self,
id: Option<PrimaryKey>,
contents: B
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error> where
C: Collection,
PrimaryKey: Send + for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
B: Into<Bytes> + Send,
fn insert<C, PrimaryKey, B>(
&self,
id: Option<PrimaryKey>,
contents: B
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error> where
C: Collection,
PrimaryKey: Send + for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
B: Into<Bytes> + Send,
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
sourcefn update<C, D>(&self, doc: &mut D) -> Result<(), Error> where
C: Collection,
D: Document<C> + Send + Sync,
fn update<C, D>(&self, doc: &mut D) -> Result<(), Error> where
C: Collection,
D: Document<C> + Send + Sync,
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
sourcefn overwrite<C, PrimaryKey>(
&self,
id: PrimaryKey,
contents: Vec<u8, Global>
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error> where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn overwrite<C, PrimaryKey>(
&self,
id: PrimaryKey,
contents: Vec<u8, Global>
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error> where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Overwrites an existing document, or inserts a new document. Upon success,
doc.revision will be updated with the new revision information. Read more
sourcefn get<C, PrimaryKey>(
&self,
id: PrimaryKey
) -> Result<Option<OwnedDocument>, Error> where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn get<C, PrimaryKey>(
&self,
id: PrimaryKey
) -> Result<Option<OwnedDocument>, Error> where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Retrieves a stored document from Collection C identified by id. Read more
sourcefn get_multiple<C, PrimaryKey, DocumentIds, I>(
&self,
ids: DocumentIds
) -> Result<Vec<OwnedDocument, Global>, Error> where
C: Collection,
DocumentIds: IntoIterator<Item = PrimaryKey, IntoIter = I> + Send + Sync,
I: Iterator<Item = PrimaryKey> + Send + Sync,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn get_multiple<C, PrimaryKey, DocumentIds, I>(
&self,
ids: DocumentIds
) -> Result<Vec<OwnedDocument, Global>, Error> where
C: Collection,
DocumentIds: IntoIterator<Item = PrimaryKey, IntoIter = I> + Send + Sync,
I: Iterator<Item = PrimaryKey> + Send + Sync,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Retrieves all documents matching ids. Documents that are not found are
not returned, but no error will be generated. Read more
sourcefn list<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<OwnedDocument, Global>, Error> where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn list<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<OwnedDocument, Global>, Error> where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Retrieves all documents within the range of ids. To retrieve all
documents, pass in .. for ids. Read more
sourcefn list_headers<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<Header, Global>, Error> where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn list_headers<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<Header, Global>, Error> where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Retrieves all documents within the range of ids. To retrieve all
documents, pass in .. for ids. Read more
sourcefn count<C, R, PrimaryKey>(&self, ids: R) -> Result<u64, Error> where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn count<C, R, PrimaryKey>(&self, ids: R) -> Result<u64, Error> where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Counts the number of documents within the range of ids. Read more
sourcefn delete<C, H>(&self, doc: &H) -> Result<(), Error> where
C: Collection,
H: HasHeader + Send + Sync,
fn delete<C, H>(&self, doc: &H) -> Result<(), Error> where
C: Collection,
H: HasHeader + Send + Sync,
Removes a Document from the database. Read more
sourcefn query<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Map<<V as View>::Key, <V as View>::Value>, Global>, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn query<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Map<<V as View>::Key, <V as View>::Value>, Global>, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
sourcefn query_with_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<OwnedDocument, V>, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn query_with_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<OwnedDocument, V>, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
sourcefn query_with_collection_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<CollectionDocument<<V as View>::Collection>, V>, Error> where
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
V: SerializedView,
<V as View>::Collection: SerializedCollection,
<<V as View>::Collection as SerializedCollection>::Contents: Debug,
fn query_with_collection_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<CollectionDocument<<V as View>::Collection>, V>, Error> where
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
V: SerializedView,
<V as View>::Collection: SerializedCollection,
<<V as View>::Collection as SerializedCollection>::Contents: Debug,
sourcefn reduce<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<<V as View>::Value, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn reduce<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<<V as View>::Value, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
sourcefn reduce_grouped<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedValue<<V as View>::Key, <V as View>::Value>, Global>, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn reduce_grouped<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedValue<<V as View>::Key, <V as View>::Value>, Global>, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
sourcefn delete_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<u64, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn delete_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<u64, Error> where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
Deletes all of the documents associated with this view. Read more
sourceimpl PubSub for RemoteDatabase
impl PubSub for RemoteDatabase
type Subscriber = RemoteSubscriber
type Subscriber = RemoteSubscriber
The Subscriber type for this PubSub connection.
sourcefn create_subscriber(&self) -> Result<Self::Subscriber, Error>
fn create_subscriber(&self) -> Result<Self::Subscriber, Error>
Create a new Subscriber for this relay.
sourcefn publish_bytes(&self, topic: Vec<u8>, payload: Vec<u8>) -> Result<(), Error>
fn publish_bytes(&self, topic: Vec<u8>, payload: Vec<u8>) -> Result<(), Error>
Publishes a payload to all subscribers of topic.
sourcefn publish_bytes_to_all(
&self,
topics: impl IntoIterator<Item = Vec<u8>> + Send,
payload: Vec<u8>
) -> Result<(), Error>
fn publish_bytes_to_all(
&self,
topics: impl IntoIterator<Item = Vec<u8>> + Send,
payload: Vec<u8>
) -> Result<(), Error>
Publishes a payload to all subscribers of all topics.
sourcefn publish<Topic, Payload>(
&self,
topic: &Topic,
payload: &Payload
) -> Result<(), Error> where
Topic: Serialize,
Payload: Serialize,
fn publish<Topic, Payload>(
&self,
topic: &Topic,
payload: &Payload
) -> Result<(), Error> where
Topic: Serialize,
Payload: Serialize,
Publishes a payload to all subscribers of topic.
sourcefn publish_to_all<'topics, Topics, Topic, Payload>(
&self,
topics: Topics,
payload: &Payload
) -> Result<(), Error> where
Topics: 'topics + IntoIterator<Item = &'topics Topic>,
Topic: 'topics + Serialize,
Payload: Serialize,
fn publish_to_all<'topics, Topics, Topic, Payload>(
&self,
topics: Topics,
payload: &Payload
) -> Result<(), Error> where
Topics: 'topics + IntoIterator<Item = &'topics Topic>,
Topic: 'topics + Serialize,
Payload: Serialize,
Publishes a payload to all subscribers of all topics.
Auto Trait Implementations
impl !RefUnwindSafe for RemoteDatabase
impl Send for RemoteDatabase
impl Sync for RemoteDatabase
impl Unpin for RemoteDatabase
impl !UnwindSafe for RemoteDatabase
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more