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

pub trait Connection<'a>: Send + Sync {
    fn collection<C: Collection + 'static>(
        &'a self
    ) -> Result<Collection<'a, Self, C>, Error>
    where
        Self: Sized
;
#[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
;
#[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
;
#[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
;
#[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<Serialized>, Error>> + Send + 'async_trait>>
    where
        Self: Sized,
        'k: 'async_trait,
        V: 'async_trait,
        'a: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
;
#[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
;
#[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
; #[must_use] fn view<V: View>(&'a self) -> View<'a, Self, V>
    where
        Self: Sized
, { ... } }

Defines all interactions with a schema::Database, 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]

Accesses a collection for the connected schema::Database.

#[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]

Inserts a newly created document into the connected schema::Database 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]

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

#[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]

Retrieves a stored document from Collection C identified by id.

#[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<Serialized>, Error>> + Send + 'async_trait>> where
    Self: Sized,
    'k: 'async_trait,
    V: 'async_trait,
    'a: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Initializes [ViewQuery] for schema::View V.

#[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]

Applies a Transaction to the schema::Database. If any operation in the Transaction fails, none of the operations will be applied to the schema::Database.

#[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]

Lists executed Transactions from this schema::Database. 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.

Loading content...

Provided methods

#[must_use]fn view<V: View>(&'a self) -> View<'a, Self, V> where
    Self: Sized
[src]

Initializes [ViewQuery] for schema::View V.

Loading content...

Implementors

Loading content...