[][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);
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
    });
}

Methods

impl ConnectionManager[src]

pub fn new(connect_params: &ConnectParams) -> ConnectionManager[src]

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, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T> Same for T

type Output = T

Should always be Self