[][src]Struct influxdb::client::InfluxDbClient

pub struct InfluxDbClient { /* fields omitted */ }

Internal Representation of a Client

Methods

impl InfluxDbClient[src]

pub fn new<S1, S2>(url: S1, database: S2) -> Self where
    S1: ToString,
    S2: ToString
[src]

Instantiates a new InfluxDbClient

Arguments

  • url: The URL where InfluxDB is running (ex. http://localhost:8086).
  • database: The Database against which queries and writes will be run.

Examples

use influxdb::client::InfluxDbClient;

let _client = InfluxDbClient::new("http://localhost:8086", "test");

pub fn database_name(&self) -> &str[src]

Returns the name of the database the client is using

pub fn database_url(&self) -> &str[src]

Returns the URL of the InfluxDB installation the client is using

pub fn ping(
    &self
) -> impl Future<Item = (String, String), Error = InfluxDbError>
[src]

Pings the InfluxDB Server

Returns a tuple of build type and version number

pub fn query<Q>(
    &self,
    q: &Q
) -> Box<dyn Future<Item = String, Error = InfluxDbError>> where
    Q: Any + InfluxDbQuery
[src]

Sends a InfluxDbReadQuery or InfluxDbWriteQuery to the InfluxDB Server.InfluxDbError

A version capable of parsing the returned string is available under the serde_integration

Arguments

Examples

use influxdb::client::InfluxDbClient;
use influxdb::query::{InfluxDbQuery, Timestamp};

let client = InfluxDbClient::new("http://localhost:8086", "test");
let _future = client.query(
    &InfluxDbQuery::write_query(Timestamp::NOW, "weather")
        .add_field("temperature", 82)
);

impl InfluxDbClient[src]

pub fn json_query(
    &self,
    q: InfluxDbReadQuery
) -> impl Future<Item = DatabaseQueryResult, Error = InfluxDbError>
[src]

Auto Trait Implementations

Blanket Implementations

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.

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

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

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

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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