Enum bonsaidb::AnyDatabase
source · [−]pub enum AnyDatabase<B: Backend = NoBackend> {
Local(ServerDatabase<B>),
Networked(RemoteDatabase),
}Expand description
A database connection that can be either from a local server or a server over a network connection.
Variants
Local(ServerDatabase<B>)
A local database.
Networked(RemoteDatabase)
A networked database accessed with a Client.
Trait Implementations
sourceimpl<B: Backend> AsyncConnection for AnyDatabase<B>
impl<B: Backend> AsyncConnection for AnyDatabase<B>
type Storage = AnyServerConnection<B>
type Storage = AnyServerConnection<B>
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_collection<'life0, 'async_trait, C>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
C: 'async_trait + Collection,
'life0: 'async_trait,
Self: 'async_trait,
fn compact_collection<'life0, 'async_trait, C>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
C: 'async_trait + Collection,
'life0: 'async_trait,
Self: 'async_trait,
Compacts the collection to reclaim unused disk space. Read more
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<B: Backend> AsyncLowLevelConnection for AnyDatabase<B>
impl<B: Backend> AsyncLowLevelConnection for AnyDatabase<B>
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 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 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 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<B: Backend> HasSession for AnyDatabase<B>
impl<B: Backend> HasSession for AnyDatabase<B>
sourcefn allowed_to<'a, R, P>(&self, resource_name: R, action: &P) -> bool where
R: AsRef<[Identifier<'a>]>,
P: Action,
fn allowed_to<'a, R, P>(&self, resource_name: R, action: &P) -> bool where
R: AsRef<[Identifier<'a>]>,
P: Action,
Checks if action is permitted against resource_name.
sourcefn check_permission<'a, R, P>(
&self,
resource_name: R,
action: &P
) -> Result<(), Error> where
R: AsRef<[Identifier<'a>]>,
P: Action,
fn check_permission<'a, R, P>(
&self,
resource_name: R,
action: &P
) -> Result<(), Error> where
R: AsRef<[Identifier<'a>]>,
P: Action,
Checks if action is permitted against resource_name. If permission
is denied, returns a PermissionDenied
error. Read more
Auto Trait Implementations
impl<B = NoBackend> !RefUnwindSafe for AnyDatabase<B>
impl<B> Send for AnyDatabase<B>
impl<B> Sync for AnyDatabase<B>
impl<B> Unpin for AnyDatabase<B>
impl<B = NoBackend> !UnwindSafe for AnyDatabase<B>
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>
impl<T> Pointable for T
impl<T> Pointable for T
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