Struct influx_client::Client [−][src]
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]
&self,
bucket: &'a str,
org: &'a str,
precision: Precision,
query: WriteQuery<'_, T>
) -> Result<(), InfluxError>
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]
&self,
org: &'a str,
query: ReadQuery<'_>
) -> Result<String, InfluxError>
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]
&self,
org: &'a str,
query: ReadQuery<'_>
) -> Result<Vec<StringRecord>, InfluxError>
pub fn get_raw(
&self,
org: &'a str,
query: &'a str
) -> Result<String, InfluxError>
[src]
&self,
org: &'a str,
query: &'a str
) -> Result<String, InfluxError>
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]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,