Struct testground::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) -> WriteQuerywhere
S: Into<String>,
pub fn new<S>(timestamp: Timestamp, measurement: S) -> WriteQuerywhere
S: Into<String>,
Creates a new WriteQuery
sourcepub fn add_field<S, F>(self, field: S, value: F) -> WriteQuerywhere
S: Into<String>,
F: WriteType,
pub fn add_field<S, F>(self, field: S, value: F) -> WriteQuerywhere
S: Into<String>,
F: WriteType,
Adds a field to the WriteQuery
Examples
use influxdb::{Query, Timestamp};
use influxdb::InfluxDbWriteable;
Timestamp::Nanoseconds(0).into_query("measurement").add_field("field1", 5).build();
sourcepub fn add_tag<S, I>(self, tag: S, value: I) -> WriteQuerywhere
S: Into<String>,
I: WriteType,
pub fn add_tag<S, I>(self, tag: S, value: I) -> WriteQuerywhere
S: Into<String>,
I: WriteType,
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};
use influxdb::InfluxDbWriteable;
Timestamp::Nanoseconds(0)
.into_query("measurement")
.add_tag("field1", 5); // calling `.build()` now would result in a `Err(Error::InvalidQueryError)`
pub fn get_precision(&self) -> String
Trait Implementations
sourceimpl Clone for WriteQuery
impl Clone for WriteQuery
sourcefn clone(&self) -> WriteQuery
fn clone(&self) -> WriteQuery
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for WriteQuery
impl Debug for WriteQuery
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more