[−][src]Struct aragog::DatabaseConnectionPool
Struct containing ArangoDB connections and information to access the database, collections and documents
Fields
collections: HashMap<String, DatabaseCollection>
Map between a collection name and a DatabaseCollection
instance
database: Database<ReqwestClient>
The database accessor
Implementations
impl DatabaseConnectionPool
[src]
pub async fn new<'_, '_, '_, '_>(
db_host: &'_ str,
db_name: &'_ str,
db_user: &'_ str,
db_password: &'_ str
) -> Self
[src]
db_host: &'_ str,
db_name: &'_ str,
db_user: &'_ str,
db_password: &'_ str
) -> Self
Creates and returns a new struct instance.
This function will base itself on environment variables and on the schema json file:
./src/config/db/schema.json
Panics
If any of the required env variables are missing the function will panic with a explanation
pub fn get_collection(&self, collection: &str) -> &Collection<ReqwestClient>
[src]
Simple wrapper to retrieve a Collection without using the HashMap directly.
Can panic if the key matching collection
is missing
pub async fn truncate<'_>(&'_ self)
[src]
DESTRUCTIVE OPERATION This will truncate all collections in the database pool, the collection will still exist but every document will be destryed.
Panics
If the truncate fails on some collection the method will panic, see the arangors
documentation
on collection truncate.
Trait Implementations
impl Clone for DatabaseConnectionPool
[src]
fn clone(&self) -> DatabaseConnectionPool
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl !RefUnwindSafe for DatabaseConnectionPool
impl Send for DatabaseConnectionPool
impl Sync for DatabaseConnectionPool
impl Unpin for DatabaseConnectionPool
impl !UnwindSafe for DatabaseConnectionPool
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,