Trait pliantdb_core::connection::Connection [−][src]
Defines all interactions with a schema::Schema, regardless of whether it is local or remote.
Required methods
fn collection<C: Collection + 'static>(
&'a self
) -> Result<Collection<'a, Self, C>, Error> where
Self: Sized, [src]
&'a self
) -> Result<Collection<'a, Self, C>, Error> where
Self: Sized,
Accesses a collection for the connected schema::Schema.
#[must_use]fn get<'life0, 'async_trait, C: Collection>(
&'life0 self,
id: u64
) -> Pin<Box<dyn Future<Output = Result<Option<Document<'static>>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
id: u64
) -> Pin<Box<dyn Future<Output = Result<Option<Document<'static>>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Retrieves a stored document from Collection C identified by id.
#[must_use]fn get_multiple<'life0, 'life1, 'async_trait, C: Collection>(
&'life0 self,
ids: &'life1 [u64]
) -> Pin<Box<dyn Future<Output = Result<Vec<Document<'static>>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
ids: &'life1 [u64]
) -> Pin<Box<dyn Future<Output = Result<Vec<Document<'static>>, 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.
#[must_use]
#[must_use]fn query<'k, 'life0, 'async_trait, V: View>(
&'life0 self,
query: View<'a, Self, V>
) -> Pin<Box<dyn Future<Output = Result<Vec<Map<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
'k: 'async_trait,
V: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
query: View<'a, Self, V>
) -> Pin<Box<dyn Future<Output = Result<Vec<Map<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
'k: 'async_trait,
V: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Queries for view entries matching View.
#[must_use]
#[must_use]fn query_with_docs<'k, 'life0, 'async_trait, V: View>(
&'life0 self,
query: View<'a, Self, V>
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedDocument<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
'k: 'async_trait,
V: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
query: View<'a, Self, V>
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedDocument<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
'k: 'async_trait,
V: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Queries for view entries matching View.
#[must_use]
#[must_use]fn reduce<'k, 'life0, 'async_trait, V: View>(
&'life0 self,
query: View<'a, Self, V>
) -> Pin<Box<dyn Future<Output = Result<V::Value, Error>> + Send + 'async_trait>> where
Self: Sized,
'k: 'async_trait,
V: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
query: View<'a, Self, V>
) -> Pin<Box<dyn Future<Output = Result<V::Value, Error>> + Send + 'async_trait>> where
Self: Sized,
'k: 'async_trait,
V: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Reduces the view entries matching View.
#[must_use]fn apply_transaction<'life0, 'async_trait>(
&'life0 self,
transaction: Transaction<'static>
) -> Pin<Box<dyn Future<Output = Result<Vec<OperationResult>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
transaction: Transaction<'static>
) -> 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.
#[must_use]fn list_executed_transactions<'life0, 'async_trait>(
&'life0 self,
starting_id: Option<u64>,
result_limit: Option<usize>
) -> Pin<Box<dyn Future<Output = Result<Vec<Executed<'static>>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
starting_id: Option<u64>,
result_limit: Option<usize>
) -> Pin<Box<dyn Future<Output = Result<Vec<Executed<'static>>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
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.
Provided methods
#[must_use]fn insert<'life0, 'async_trait, C: Collection>(
&'life0 self,
contents: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<Header, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
contents: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<Header, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Inserts a newly created document into the connected schema::Schema for the Collection C.
#[must_use]fn update<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
doc: &'life1 mut Document<'life2>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
doc: &'life1 mut Document<'life2>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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.
#[must_use]fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
doc: &'life1 Document<'life2>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait, [src]
&'life0 self,
doc: &'life1 Document<'life2>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Removes a Document from the database.
#[must_use]fn view<V: View>(&'a self) -> View<'a, Self, V> where
Self: Sized, [src]
Self: Sized,
Initializes View for schema::View V.