[][src]Struct hdbconnect::ConnectionManager

pub struct ConnectionManager { /* fields omitted */ }

Implementation of r2d2's ManageConnection interface.

Example


let connect_params = ConnectParams::builder()
    .hostname("abcd123")
    .port(2222)
    .dbuser("MEIER")
    .password("schlau")
    .build()
    .unwrap();
let manager = ConnectionManager::new(&connect_params).unwrap();
let pool = r2d2::Pool::builder().max_size(POOL_SIZE).build(manager).unwrap();

for _ in 0..NUM_THREADS {
    let pool = pool.clone();
    thread::spawn(move || {
        let mut conn = pool.get().unwrap();
        // ... work with your connection
    });
}

Implementations

impl ConnectionManager[src]

pub fn new<P: IntoConnectParams>(p: P) -> HdbResult<Self>[src]

Creates a new ConnectionManager.

Errors

HdbError::Usage if not enough or inconsistent information was provided

Trait Implementations

impl Debug for ConnectionManager[src]

impl ManageConnection for ConnectionManager[src]

type Connection = Connection

The connection type this manager deals with.

type Error = HdbError

The error type returned by Connections.

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> Same<T> for T

type Output = T

Should always be Self

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>,