Struct db_core::instance::Instance[][src]

pub struct Instance { /* fields omitted */ }
Expand description

Instance provides interface for the client to interact with the system: initiate and complete transaction, write and read data, etc.

Implementations

Create a new instance with given configuration.

Initialize datastore: create data, checkpoint, versioning store files, and lock file.

Add a new file to datastore and return it’s file_id.

Begin a new transaction.

Commit transaction.

Rollback transaction.

Open an existing object for read. After object is opened it is possible to read and seek through object’s data.

Open an existing object for modification by its id. After object is opened it is possible to read, write and seek through object data. This operation puts lock on the object which is released after transaction commit or rollback. If timeout is -1 then wait indefinitely, otherwise wait for requested time in ms before returning error, or until transaction holding lock on the object has finished.

Create a new object and open it for write. After object is opened it is possible to read, write and seek object data. This operation puts lock on the object which is released after transaction commit or rollback.

Delete an object. If object is in use, timeout can be specified, and current transaction will wait given time until transaction holding the lock on the object has finished.

Build instance using shared state.

Return shared state that can be shared between threads.

Terminate the instance. If several instances are running and sharing state then function has no effect for any of them but the last one. It is up to client to make sure all transactions are finished, otherwise unfinished transactions will be rolled back on the next start.

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

Performs the conversion.

Performs the conversion.

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.