[][src]Struct r2d2_influxdb::InfluxDBConnectionManager

pub struct InfluxDBConnectionManager { /* fields omitted */ }

Methods

impl InfluxDBConnectionManager[src]

Trait Implementations

impl Debug for InfluxDBConnectionManager[src]

impl ManageConnection for InfluxDBConnectionManager[src]

An r2d2::ConnectionManager for InfluxDB::Clients.

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