Struct influx_client::Client[][src]

pub struct Client<'a> { /* fields omitted */ }

Use a Client to connect to your influx database and execute queries.

Implementations

impl<'a> Client<'a>[src]

pub fn new(url: &'a str, token: &'a str) -> Self[src]

Create a client with a given database URL and token.

pub fn from_env(url: &'a str) -> Result<Self, InfluxError>[src]

Create a client that reads its token from the INFLUXDB_TOKEN environment variable

pub fn insert<T: Display>(
    &self,
    bucket: &'a str,
    org: &'a str,
    precision: Precision,
    query: WriteQuery<'_, T>
) -> Result<(), InfluxError>
[src]

Insert a new value into a bucket. Note that not all attributes on WriteQuery are supported yet.

pub fn get(
    &self,
    org: &'a str,
    query: ReadQuery<'_>
) -> Result<String, InfluxError>
[src]

Retrieve a value from a bucket based on certain filters.

pub fn get_csv(
    &self,
    org: &'a str,
    query: ReadQuery<'_>
) -> Result<Vec<StringRecord>, InfluxError>
[src]

pub fn get_raw(
    &self,
    org: &'a str,
    query: &'a str
) -> Result<String, InfluxError>
[src]

If you prefer to write your own flux queries, use this method. As flux support is not complete yet, this is currently the only way to use the full flux language.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Client<'a>

impl<'a> Send for Client<'a>

impl<'a> Sync for Client<'a>

impl<'a> Unpin for Client<'a>

impl<'a> !UnwindSafe for Client<'a>

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> Instrument 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<V, T> VZip<V> for T where
    V: MultiLane<T>,