Browse Source

adds some inline annotations

master
Jonathan Strong 6 years ago
parent
commit
dafab36104
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/influx.rs

+ 4
- 0
src/influx.rs View File

@@ -199,14 +199,18 @@ impl Clone for InfluxWriter {
impl InfluxWriter {
/// Sends the `OwnedMeasurement` to the serialization thread.
///
#[inline]
pub fn send(&self, m: OwnedMeasurement) -> Result<(), SendError<Option<OwnedMeasurement>>> {
self.tx.send(Some(m))
}

#[inline]
pub fn nanos(&self, d: DateTime<Utc>) -> i64 { nanos(d) as i64 }

#[inline]
pub fn dur_nanos(&self, d: Duration) -> i64 { dur_nanos(d) as i64 }

#[inline]
pub fn dur_nanos_u64(&self, d: Duration) -> u64 { dur_nanos(d).max(0) as u64 }

pub fn tx(&self) -> Sender<Option<OwnedMeasurement>> {


Loading…
Cancel
Save