[−][src]Struct influxdb::client::InfluxDbClient
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]
S1: ToString,
S2: ToString,
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]
&self
) -> impl Future<Item = (String, String), Error = InfluxDbError>
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]
&self,
q: &Q
) -> Box<dyn Future<Item = String, Error = InfluxDbError>> where
Q: Any + InfluxDbQuery,
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
q
: Query of typeInfluxDbReadQuery
orInfluxDbWriteQuery
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]
&self,
q: InfluxDbReadQuery
) -> impl Future<Item = DatabaseQueryResult, Error = InfluxDbError>
Auto Trait Implementations
impl Unpin for InfluxDbClient
impl Sync for InfluxDbClient
impl Send for InfluxDbClient
impl RefUnwindSafe for InfluxDbClient
impl UnwindSafe for InfluxDbClient
Blanket Implementations
impl<T> From<T> for T
[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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,