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, F>(self, field: S, value: F) -> Self where
S: Into<String>,
F: WriteType,
pub fn add_field<S, F>(self, field: S, value: F) -> Self where
S: Into<String>,
F: WriteType,
Adds a field to the WriteQuery
Examples
use influxdb::{Query, Timestamp};
use influxdb::InfluxDbWriteable;
Timestamp::Now.into_query("measurement").add_field("field1", 5).build();
sourcepub fn add_tag<S, I>(self, tag: S, value: I) -> Self where
S: Into<String>,
I: WriteType,
pub fn add_tag<S, I>(self, tag: S, value: I) -> Self where
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::Now
.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<'a> From<&'a WriteQuery> for QueryTypes<'a>
impl<'a> From<&'a WriteQuery> for QueryTypes<'a>
sourcefn from(query: &'a WriteQuery) -> Self
fn from(query: &'a WriteQuery) -> Self
Performs the conversion.
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more