serde_ltsv
Labeled Tab-separated Values (LTSV) format is a variant of Tab-separated Values (TSV). Each record in a LTSV file is represented as a single line. Each field is separated by TAB and has a label and a value. The label and the value have been separated by ':'. With the LTSV format, you can parse each line by spliting with TAB (like original TSV format) easily, and extend any fields with unique labels in no particular order.
time: \tdone:true\tscore:-1\tmean:0.42\tcounter:42\tlevel:3\thost:testhostname\tname1:value1\tname 2: value 2\tn3:v3\tmessage:this is a test
Quickstart
You can start using it by first adding it to your Cargo.toml
:
[]
= "1.0"
= "0.1"
Then, create a structure which implement serde::Serialize
/ serde::Deserialize
traits and
use the structure with any serde lib.
extern crate serde_derive;
extern crate serde_ltsv;
extern crate serde_json;
extern crate serde_yaml;
Output:
As ltsv => a:toto b:8 c:true
As json => {
"a": "toto",
"b": 8,
"c": true
}
As yaml => ---
a: toto
b: 8
c: true
License: BSD-3-Clause