Struct influxdb::query::write_query::InfluxDbWriteQuery
source · [−]pub struct InfluxDbWriteQuery { /* private fields */ }
Expand description
Internal Representation of a Write query that has not yet been built
Implementations
sourceimpl InfluxDbWriteQuery
impl InfluxDbWriteQuery
sourcepub fn new<S>(timestamp: Timestamp, measurement: S) -> Self where
S: ToString,
pub fn new<S>(timestamp: Timestamp, measurement: S) -> Self where
S: ToString,
Creates a new InfluxDbWriteQuery
sourcepub fn add_field<S, I>(self, tag: S, value: I) -> Self where
S: ToString,
I: Into<InfluxDbType>,
pub fn add_field<S, I>(self, tag: S, value: I) -> Self where
S: ToString,
I: Into<InfluxDbType>,
Adds a field to the InfluxDbWriteQuery
Examples
use influxdb::query::{InfluxDbQuery, Timestamp};
InfluxDbQuery::write_query(Timestamp::NOW, "measurement").add_field("field1", 5).build();
sourcepub fn add_tag<S, I>(self, tag: S, value: I) -> Self where
S: ToString,
I: Into<InfluxDbType>,
pub fn add_tag<S, I>(self, tag: S, value: I) -> Self where
S: ToString,
I: Into<InfluxDbType>,
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(&self) -> String
Trait Implementations
sourceimpl InfluxDbQuery for InfluxDbWriteQuery
impl InfluxDbQuery for InfluxDbWriteQuery
Auto Trait Implementations
impl RefUnwindSafe for InfluxDbWriteQuery
impl Send for InfluxDbWriteQuery
impl Sync for InfluxDbWriteQuery
impl Unpin for InfluxDbWriteQuery
impl UnwindSafe for InfluxDbWriteQuery
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more