[][src]Struct influxdb::query::write_query::InfluxDbWriteQuery

pub struct InfluxDbWriteQuery { /* fields omitted */ }

Internal Representation of a Write query that has not yet been built

Methods

impl InfluxDbWriteQuery[src]

pub fn new<S>(timestamp: Timestamp, measurement: S) -> Self where
    S: ToString
[src]

Creates a new InfluxDbWriteQuery

pub fn add_field<S, I>(self, tag: S, value: I) -> Self where
    S: ToString,
    I: Into<InfluxDbType>, 
[src]

Adds a field to the InfluxDbWriteQuery

Examples

use influxdb::query::{InfluxDbQuery, Timestamp};

InfluxDbQuery::write_query(Timestamp::NOW, "measurement").add_field("field1", 5).build();

pub fn add_tag<S, I>(self, tag: S, value: I) -> Self where
    S: ToString,
    I: Into<InfluxDbType>, 
[src]

Adds a tag to the InfluxDbWriteQuery

Please note that a InfluxDbWriteQuery requires at least one field. Composing a query with only tags will result in a failure building the query.

Examples

use influxdb::query::{InfluxDbQuery, Timestamp};

InfluxDbQuery::write_query(Timestamp::NOW, "measurement")
    .add_tag("field1", 5); // calling `.build()` now would result in a `Err(InfluxDbError::InvalidQueryError)`

pub fn get_precision_modifier(&self) -> String[src]

Trait Implementations

impl InfluxDbQuery for InfluxDbWriteQuery[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> 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<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err