[−][src]Struct influent::measurement::Measurement
Measurement model.
Fields
key: &'a str
Key.
timestamp: Option<i64>
Timestamp.
fields: BTreeMap<Cow<'a, str>, Value<'a>>
Map of fields.
Map of tags.
Methods
impl<'a> Measurement<'a>
[src]
pub fn new(key: &str) -> Measurement
[src]
Constructs a new Measurement
.
Examples
use influent::measurement::Measurement; let measurement = Measurement::new("key");
pub fn add_field<T>(&mut self, field: T, value: Value<'a>) where
T: Into<Cow<'a, str>>,
[src]
T: Into<Cow<'a, str>>,
Adds field to the measurement.
Examples
use influent::measurement::{Measurement, Value}; let mut measurement = Measurement::new("key"); measurement.add_field("field", Value::String("hello"));
pub fn add_tag<I, K>(&mut self, tag: I, value: K) where
I: Into<Cow<'a, str>>,
K: Into<Cow<'a, str>>,
[src]
I: Into<Cow<'a, str>>,
K: Into<Cow<'a, str>>,
Adds tag to the measurement.
Examples
use influent::measurement::{Measurement, Value}; let mut measurement = Measurement::new("key"); measurement.add_tag("tag", "value");
pub fn set_timestamp(&mut self, timestamp: i64)
[src]
Sets the timestamp of the measurement. It should be unix timestamp in nanosecond
Examples
use influent::measurement::{Measurement, Value}; let mut measurement = Measurement::new("key"); measurement.set_timestamp(1434055562000000000)
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Measurement<'a>
impl<'a> Send for Measurement<'a>
impl<'a> Sync for Measurement<'a>
impl<'a> Unpin for Measurement<'a>
impl<'a> UnwindSafe for Measurement<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,