pub struct StorageManager<Db: Database + Sync + Send> {
    pub db: Db,
    /* private fields */
}
Expand description

Represents the manager of the storage mediums, including caching and transactional operations (creating the transaction, commiting it, etc)

Fields§

§db: Db

The underlying database managed by this storage manager

Implementations§

Create a new storage manager with NO CACHE

Create a new storage manager with a cache utilizing the options provided (or defaults)

Log metrics from the storage manager (cache, transaction, and storage hit rates etc)

Start an in-memory transaction of changes

Commit a transaction in the database

Rollback a transaction

Retrieve a flag determining if there is a transaction active

Store a record in the database

Set a batch of records in the database

Retrieve a stored record directly from the data layer, ignoring any caching or transaction processes

Retrieve a stored record from the database

Retrieve a batch of records by id from the database

Flush the caching of objects (if present)

Tombstone a set of records adhereing to the caching + transactional settings of the storage manager

Retrieve the specified user state object based on the retrieval flag from the database

Retrieve all values states for a given user

Retrieve the user -> state version mapping in bulk. This is the same as get_user_state in a loop, but with less data retrieved from the storage layer

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.