[][src]Struct aragog::DatabaseConnectionPool

pub struct DatabaseConnectionPool {
    pub collections: HashMap<String, DatabaseCollection>,
    pub database: Database<ReqwestClient>,
}

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]

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]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,