Struct influxdb::WriteQuery
source · [−]pub struct WriteQuery { /* private fields */ }
Expand description
Internal Representation of a Write query that has not yet been built
Implementations
sourceimpl WriteQuery
impl WriteQuery
sourcepub fn new<S>(timestamp: Timestamp, measurement: S) -> Self where
S: Into<String>,
pub fn new<S>(timestamp: Timestamp, measurement: S) -> Self where
S: Into<String>,
Creates a new WriteQuery
sourcepub fn add_field<S, I>(self, tag: S, value: I) -> Self where
S: Into<String>,
I: Into<Type>,
pub fn add_field<S, I>(self, tag: S, value: I) -> Self where
S: Into<String>,
I: Into<Type>,
Adds a field to the WriteQuery
Examples
use influxdb::{Query, Timestamp};
Query::write_query(Timestamp::NOW, "measurement").add_field("field1", 5).build();
sourcepub fn add_tag<S, I>(self, tag: S, value: I) -> Self where
S: Into<String>,
I: Into<Type>,
pub fn add_tag<S, I>(self, tag: S, value: I) -> Self where
S: Into<String>,
I: Into<Type>,
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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WriteQuery
impl Send for WriteQuery
impl Sync for WriteQuery
impl Unpin for WriteQuery
impl UnwindSafe for WriteQuery
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