pub trait StorageClient {
    type Backend: StorageBackend;
    type TransactionId: Clone + Eq + Hash + Send + Serialize + Sync;

    // Required method
    fn transaction_id(&self) -> Option<Self::TransactionId>;
}
Expand description

A client for communicating with a storage backend. Typically this should be implemented for connection or client implementations for that backend, e.g. diesel_async::AsyncPgConnection.

Required Associated Types§

source

type Backend: StorageBackend

The backend this client will act upon.

source

type TransactionId: Clone + Eq + Hash + Send + Serialize + Sync

The type for ids associated with transactions used by this client. If this client does not support transactions just set this value to ().

Required Methods§

source

fn transaction_id(&self) -> Option<Self::TransactionId>

Returns the current transaction id if there is one available for this client. Must return Some for clients which expect to use a transaction cache to assist a decision maker. If this client does not support transactions just return None.

Implementors§

source§

impl<C: Db> StorageClient for C

Available on crate feature diesel-storage-backend only.
§

type Backend = <C as Db>::Backend

§

type TransactionId = Uuid