[−][src]Struct r2d2_influxdb::InfluxDBConnectionManager
Methods
impl InfluxDBConnectionManager
[src]
pub fn new<T: Into<InfluxDBConnectionInfo>>(
params: T
) -> InfluxDBConnectionManager
[src]
params: T
) -> InfluxDBConnectionManager
Trait Implementations
impl Debug for InfluxDBConnectionManager
[src]
impl ManageConnection for InfluxDBConnectionManager
[src]
An r2d2::ConnectionManager
for InfluxDB::Client
s.
Example
extern crate r2d2_influxdb; use r2d2_influxdb::{r2d2, InfluxDBConnectionManager, SimpleInfo}; use std::thread; fn main() { let info = SimpleInfo { url: "http://localhost:8086".into(), database: "test".into(), }; let manager = InfluxDBConnectionManager::new(info); let pool = r2d2::Pool::builder().build(manager).unwrap(); let mut handles = vec![]; for _i in 0..10i32 { let pool = pool.clone(); handles.push(thread::spawn(move || { let conn = pool.get().unwrap(); let reply = conn.ping(); println!("{:?}", reply); assert!(reply.is_ok()) })); } for h in handles { h.join().unwrap(); } }
type Connection = SyncClient
The connection type this manager deals with.
type Error = Error
The error type returned by Connection
s.
fn connect(&self) -> Result<SyncClient, Error>
[src]
fn is_valid(&self, conn: &mut SyncClient) -> Result<(), Error>
[src]
fn has_broken(&self, conn: &mut SyncClient) -> bool
[src]
Auto Trait Implementations
impl RefUnwindSafe for InfluxDBConnectionManager
impl Send for InfluxDBConnectionManager
impl Sync for InfluxDBConnectionManager
impl Unpin for InfluxDBConnectionManager
impl UnwindSafe for InfluxDBConnectionManager
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,
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, 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.
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>,