[][src]Struct influxdb::WriteQuery

pub struct WriteQuery { /* fields omitted */ }

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

Methods

impl WriteQuery[src]

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

Creates a new WriteQuery

pub fn add_field<S, F>(self, tag: S, value: F) -> Self where
    S: Into<String>,
    F: WriteField, 
[src]

Adds a field to the WriteQuery

Examples

use influxdb::{Query, Timestamp};

Query::write_query(Timestamp::Now, "measurement").add_field("field1", 5).build();

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

Adds a tag to the WriteQuery

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

Examples

use influxdb::{Query, Timestamp};

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

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

Trait Implementations

impl<'a> From<&'a WriteQuery> for QueryTypes<'a>[src]

impl Query for WriteQuery[src]

Auto Trait Implementations

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, 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.