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
Managerfor creating and recycling ApexBaseApexDBconnections.- Metrics
- Statistics regarding an object returned by the pool
- Object
Id - A unique identifier for an object within a pool.
- Pool
Config Poolconfiguration.- Status
- The current pool status.
- Sync
Guard - This guard is returned when calling
SyncWrapper::lockorSyncWrapper::try_lock. This is basically just a wrapper around aMutexGuardbut hides some implementation details. - Timeouts
- Timeouts when getting
Objects from aPool.
Enums§
- Interact
Error - Possible errors returned when
SyncWrapper::interact()fails. - Runtime
- Enumeration for picking a runtime implementation.
- Timeout
Type - Possible steps causing the timeout in an error returned by
Pool::get()method.
Type Aliases§
- Build
Error - Type alias for using
deadpool::managed::BuildErrorwithapexbase. - Config
Error - This error is returned if there is something wrong with the ApexBase configuration.
- Connection
- Type alias for
Object - Create
Pool Error - Type alias for using
deadpool::managed::CreatePoolErrorwithapexbase. - Hook
- Type alias for using
deadpool::managed::Hookwithapexbase. - Hook
Error - Type alias for using
deadpool::managed::HookErrorwithapexbase. - Object
- Type alias for using
deadpool::managed::Objectwithapexbase. - Pool
- Type alias for using
deadpool::managed::Poolwithapexbase. - Pool
Builder - Type alias for using
deadpool::managed::PoolBuilderwithapexbase. - Pool
Error - Type alias for using
deadpool::managed::PoolErrorwithapexbase. - Weak
Pool - Type alias for using
deadpool::managed::Poolwithapexbase.