[−][src]Struct hdbconnect::ConnectionManager
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]
impl ConnectionManager
pub fn new(connect_params: &ConnectParams) -> ConnectionManager | [src] |
Trait Implementations
impl Debug for ConnectionManager
[src]
impl Debug for ConnectionManager
impl ManageConnection for ConnectionManager
[src]
impl ManageConnection for ConnectionManager
type Connection = Connection
The connection type this manager deals with.
type Error = HdbError
The error type returned by Connection
s.
fn connect(&self) -> Result<Self::Connection, Self::Error> | [src] |
fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error> | [src] |
fn has_broken(&self, _conn: &mut Self::Connection) -> bool | [src] |
Auto Trait Implementations
impl Send for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Sync for ConnectionManager
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self