Skip to main content

Crate deadpool_apexbase

Crate deadpool_apexbase 

Source
Expand description

§deadpool-apexbase

Dead simple async pool for ApexBase embedded database.

§Example

use deadpool_apexbase::{Config, Runtime};

let cfg = Config::new("/tmp/apexbase_db");
let pool = cfg.create_pool(Runtime::Tokio1).unwrap();
let db = pool.get().await.unwrap();

let count = db
    .interact(|apexdb| {
        let table = apexdb.create_table("users").unwrap();
        // ...
        table.count().unwrap()
    })
    .await
    .unwrap();

§License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Re-exports§

pub use apexbase;

Structs§

Config
Configuration object for deadpool-apexbase.
Manager
Manager for creating and recycling ApexBase ApexDB connections.
Metrics
Statistics regarding an object returned by the pool
ObjectId
A unique identifier for an object within a pool.
PoolConfig
Pool configuration.
Status
The current pool status.
SyncGuard
This guard is returned when calling SyncWrapper::lock or SyncWrapper::try_lock. This is basically just a wrapper around a MutexGuard but hides some implementation details.
Timeouts
Timeouts when getting Objects from a Pool.

Enums§

InteractError
Possible errors returned when SyncWrapper::interact() fails.
Runtime
Enumeration for picking a runtime implementation.
TimeoutType
Possible steps causing the timeout in an error returned by Pool::get() method.

Type Aliases§

BuildError
Type alias for using deadpool::managed::BuildError with apexbase.
ConfigError
This error is returned if there is something wrong with the ApexBase configuration.
Connection
Type alias for Object
CreatePoolError
Type alias for using deadpool::managed::CreatePoolError with apexbase.
Hook
Type alias for using deadpool::managed::Hook with apexbase.
HookError
Type alias for using deadpool::managed::HookError with apexbase.
Object
Type alias for using deadpool::managed::Object with apexbase.
Pool
Type alias for using deadpool::managed::Pool with apexbase.
PoolBuilder
Type alias for using deadpool::managed::PoolBuilder with apexbase.
PoolError
Type alias for using deadpool::managed::PoolError with apexbase.
WeakPool
Type alias for using deadpool::managed::Pool with apexbase.