[][src]Struct influx_db_client::client::Client

pub struct Client { /* fields omitted */ }

The client to influxdb

Implementations

impl Client[src]

pub fn new<T>(host: Url, db: T) -> Self where
    T: Into<String>, 
[src]

Create a new influxdb client with http

pub fn new_with_client<T>(host: Url, db: T, client: HttpClient) -> Self where
    T: Into<String>, 
[src]

Create a new influxdb client with custom reqwest's client.

pub fn switch_database<T>(&mut self, database: T) where
    T: Into<String>, 
[src]

Change the client's database

pub fn set_authentication<T>(self, user: T, passwd: T) -> Self where
    T: Into<String>, 
[src]

Change the client's user

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

View the current db name

pub fn ping(&self) -> impl Future<Output = bool>[src]

Query whether the corresponding database exists, return bool

pub fn get_version(&self) -> impl Future<Output = Option<String>>[src]

Query the version of the database and return the version number

pub fn write_point(
    &self,
    point: Point,
    precision: Option<Precision>,
    rp: Option<&str>
) -> impl Future<Output = Result<(), Error>>
[src]

Write a point to the database

pub fn write_points<T: Iterator<Item = Point>>(
    &self,
    points: T,
    precision: Option<Precision>,
    rp: Option<&str>
) -> impl Future<Output = Result<(), Error>>
[src]

Write multiple points to the database

pub fn query(
    &self,
    q: &str,
    epoch: Option<Precision>
) -> impl Future<Output = Result<Option<Vec<Node>>, Error>>
[src]

Query and return data, the data type is Option<Vec<Node>>

pub fn query_chunked(
    &self,
    q: &str,
    epoch: Option<Precision>
) -> impl Future<Output = Result<ChunkedQuery<'static, IoRead<Cursor<Bytes>>>, Error>>
[src]

Query and return data, the data type is Option<Vec<Node>>

pub fn drop_measurement(
    &self,
    measurement: &str
) -> impl Future<Output = Result<(), Error>>
[src]

Drop measurement

pub fn create_database(
    &self,
    dbname: &str
) -> impl Future<Output = Result<(), Error>>
[src]

Create a new database in InfluxDB.

pub fn drop_database(
    &self,
    dbname: &str
) -> impl Future<Output = Result<(), Error>>
[src]

Drop a database from InfluxDB.

pub fn create_user(
    &self,
    user: &str,
    passwd: &str,
    admin: bool
) -> impl Future<Output = Result<(), Error>>
[src]

Create a new user in InfluxDB.

pub fn drop_user(&self, user: &str) -> impl Future<Output = Result<(), Error>>[src]

Drop a user from InfluxDB.

pub fn set_user_password(
    &self,
    user: &str,
    passwd: &str
) -> impl Future<Output = Result<(), Error>>
[src]

Change the password of an existing user.

pub fn grant_admin_privileges(
    &self,
    user: &str
) -> impl Future<Output = Result<(), Error>>
[src]

Grant cluster administration privileges to a user.

pub fn revoke_admin_privileges(
    &self,
    user: &str
) -> impl Future<Output = Result<(), Error>>
[src]

Revoke cluster administration privileges from a user.

pub fn grant_privilege(
    &self,
    user: &str,
    db: &str,
    privilege: &str
) -> impl Future<Output = Result<(), Error>>
[src]

Grant a privilege on a database to a user. :param privilege: the privilege to grant, one of 'read', 'write' or 'all'. The string is case-insensitive

pub fn revoke_privilege(
    &self,
    user: &str,
    db: &str,
    privilege: &str
) -> impl Future<Output = Result<(), Error>>
[src]

Revoke a privilege on a database from a user. :param privilege: the privilege to grant, one of 'read', 'write' or 'all'. The string is case-insensitive

pub fn create_retention_policy(
    &self,
    name: &str,
    duration: &str,
    replication: &str,
    default: bool,
    db: Option<&str>
) -> impl Future<Output = Result<(), Error>>
[src]

Create a retention policy for a database. :param duration: the duration of the new retention policy. Durations such as 1h, 90m, 12h, 7d, and 4w, are all supported and mean 1 hour, 90 minutes, 12 hours, 7 day, and 4 weeks, respectively. For infinite retention – meaning the data will never be deleted – use 'INF' for duration. The minimum retention period is 1 hour.

pub fn drop_retention_policy(
    &self,
    name: &str,
    db: Option<&str>
) -> impl Future<Output = Result<(), Error>>
[src]

Drop an existing retention policy for a database.

Trait Implementations

impl Clone for Client[src]

impl Debug for Client[src]

impl Default for Client[src]

fn default() -> Self[src]

connecting for default database test and host http://localhost:8086

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.