[−][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).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 Connection
s.
pub fn connect(&self) -> Result<Self::Connection, Self::Error>
[src]
pub fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error>
[src]
pub fn has_broken(&self, _conn: &mut Self::Connection) -> bool
[src]
Auto Trait Implementations
impl RefUnwindSafe for ConnectionManager
[src]
impl Send for ConnectionManager
[src]
impl Sync for ConnectionManager
[src]
impl Unpin for ConnectionManager
[src]
impl UnwindSafe for ConnectionManager
[src]
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,
pub 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> Same<T> for T
type Output = T
Should always be Self
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,