Trait pliantdb_core::connection::Connection[][src]

pub trait Connection: Send + Sync {
Show methods 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
;
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
;
fn query<'life0, 'async_trait, V: View>(
        &'life0 self,
        key: Option<QueryKey<V::Key>>,
        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_with_docs<'life0, 'async_trait, V: View>(
        &'life0 self,
        key: Option<QueryKey<V::Key>>,
        access_policy: AccessPolicy
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MappedDocument<V::Key, V::Value>>, Error>> + Send + 'async_trait>>
    where
        Self: Sized,
        V: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
;
fn reduce<'life0, 'async_trait, V: View>(
        &'life0 self,
        key: Option<QueryKey<V::Key>>,
        access_policy: AccessPolicy
    ) -> Pin<Box<dyn Future<Output = Result<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: View>(
        &'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 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
;
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
;
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
; fn collection<'a, C: Collection + 'static>(
        &'a self
    ) -> Collection<'a, Self, C>
    where
        Self: Sized
, { ... }
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
, { ... }
fn update<'life0, 'life1, 'life2, 'async_trait, C: Collection>(
        &'life0 self,
        doc: &'life1 mut Document<'life2>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        C: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... }
fn delete<'life0, 'life1, 'life2, 'async_trait, C: Collection>(
        &'life0 self,
        doc: &'life1 Document<'life2>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        C: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... }
fn view<V: View>(&self) -> View<'_, Self, V>
    where
        Self: Sized
, { ... }
}
Expand description

Defines all interactions with a schema::Schema, regardless of whether it is local or remote.

Required methods

Retrieves a stored document from Collection C identified by id.

Retrieves all documents matching ids. Documents that are not found are not returned, but no error will be generated.

Queries for view entries matching View.

Queries for view entries matching View.

Reduces the view entries matching View.

Reduces the view entries matching View, reducing the values by each unique key.

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.

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.

Fetches the last transaction id that has been committed, if any.

Provided methods

Accesses a collection for the connected schema::Schema.

Inserts a newly created document into the connected schema::Schema for the Collection C.

Updates an existing document in the connected schema::Schema for the Collection C. Upon success, doc.revision will be updated with the new revision.

Removes a Document from the database.

Initializes View for schema::View V.

Implementors