[−][src]Struct influx_db_client::client::Client
The client to influxdb
Implementations
impl Client
[src]
pub fn new<T>(host: Url, db: T) -> Self where
T: Into<String>,
[src]
T: Into<String>,
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]
T: Into<String>,
Create a new influxdb client with custom reqwest's client.
pub fn switch_database<T>(&mut self, database: T) where
T: Into<String>,
[src]
T: Into<String>,
Change the client's database
pub fn set_authentication<T>(self, user: T, passwd: T) -> Self where
T: Into<String>,
[src]
T: Into<String>,
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]
&self,
point: Point,
precision: Option<Precision>,
rp: Option<&str>
) -> impl Future<Output = Result<(), Error>>
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]
&self,
points: T,
precision: Option<Precision>,
rp: Option<&str>
) -> impl Future<Output = Result<(), Error>>
Write multiple points to the database
pub fn query(
&self,
q: &str,
epoch: Option<Precision>
) -> impl Future<Output = Result<Option<Vec<Node>>, Error>>
[src]
&self,
q: &str,
epoch: Option<Precision>
) -> impl Future<Output = Result<Option<Vec<Node>>, Error>>
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]
&self,
q: &str,
epoch: Option<Precision>
) -> impl Future<Output = Result<ChunkedQuery<'static, IoRead<Cursor<Bytes>>>, Error>>
Query and return data, the data type is Option<Vec<Node>>
pub fn drop_measurement(
&self,
measurement: &str
) -> impl Future<Output = Result<(), Error>>
[src]
&self,
measurement: &str
) -> impl Future<Output = Result<(), Error>>
Drop measurement
pub fn create_database(
&self,
dbname: &str
) -> impl Future<Output = Result<(), Error>>
[src]
&self,
dbname: &str
) -> impl Future<Output = Result<(), Error>>
Create a new database in InfluxDB.
pub fn drop_database(
&self,
dbname: &str
) -> impl Future<Output = Result<(), Error>>
[src]
&self,
dbname: &str
) -> impl Future<Output = Result<(), Error>>
Drop a database from InfluxDB.
pub fn create_user(
&self,
user: &str,
passwd: &str,
admin: bool
) -> impl Future<Output = Result<(), Error>>
[src]
&self,
user: &str,
passwd: &str,
admin: bool
) -> impl Future<Output = Result<(), Error>>
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]
&self,
user: &str,
passwd: &str
) -> impl Future<Output = Result<(), Error>>
Change the password of an existing user.
pub fn grant_admin_privileges(
&self,
user: &str
) -> impl Future<Output = Result<(), Error>>
[src]
&self,
user: &str
) -> impl Future<Output = Result<(), Error>>
Grant cluster administration privileges to a user.
pub fn revoke_admin_privileges(
&self,
user: &str
) -> impl Future<Output = Result<(), Error>>
[src]
&self,
user: &str
) -> impl Future<Output = Result<(), Error>>
Revoke cluster administration privileges from a user.
pub fn grant_privilege(
&self,
user: &str,
db: &str,
privilege: &str
) -> impl Future<Output = Result<(), Error>>
[src]
&self,
user: &str,
db: &str,
privilege: &str
) -> impl Future<Output = Result<(), Error>>
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]
&self,
user: &str,
db: &str,
privilege: &str
) -> impl Future<Output = Result<(), Error>>
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]
&self,
name: &str,
duration: &str,
replication: &str,
default: bool,
db: Option<&str>
) -> impl Future<Output = Result<(), Error>>
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]
&self,
name: &str,
db: Option<&str>
) -> impl Future<Output = Result<(), Error>>
Drop an existing retention policy for a database.
Trait Implementations
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]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,