A serializer for Rust structs according to InfluxDB 3 line protocol.
When writing data to InfluxDB 3 Core, we have to write_lp API which differs from JSON.
This crate defines a derive macro called Influx3Lp to assit write process.
use Influx3Lp;
let data = SensorData ;
// call `to_lp` function to transform struct to a String
let serialized = data.to_lp;
assert_eq!
These are features implemented by influx3_lp:
#[influx3_lp(timestamp)]attribute is optional- multiple
#[influx3_lp(tag)]atrributes are supported - empty tag is supported also
- tag values and field values are escaped according to line protocol
- field string has a length limit of 64K
i8,i16,i32,i64field values are appended withiu8,u16,u32,u64field values are appended withu- field type of
Option<T>is supported