librsv 0.1.1

A simple crate for encoding/decoding the RSV file format (Rows of String Values).
Documentation
  • Coverage
  • 100%
    23 out of 23 items documented3 out of 20 items with examples
  • Size
  • Source code size: 14 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.36 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Rafferty97/rust-rsv
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Rafferty97

Full documentation: https://docs.rs/librsv/0.1.0/librsv/

RSV (Rows of String Values) is a very simple binary format for encoding tabular data. It is similar to CSV, but even simpler due to the avoidance of escape characters. This is achieved by encoding strings as UTF-8, and using bytes that can never appear in valid UTF-8 strings as delimiters.

The full specification can be found at: https://github.com/Stenway/RSV-Specification

Basic usage

There are three convenience methods for encoding and decoding RSV documents in one go:

  • encode_rsv - Encodes an RSV document from a structure such as Vec<Vec<Option<String>>>.
  • decode_rsv- Decodes an RSV document into a Vec<Vec<Option<String>>>.
  • decode_rsv_borrowed- Decodes an RSV document into a Vec<Vec<Option<&str>>>.
use librsv::{encode_rsv, decode_rsv};

let data = vec![
    vec![Some("Hello".into()), Some("world".into())],
    vec![Some("asdf".into()), None, Some("".into())],
];

let encoded = encode_rsv(&data);
let decoded = decode_rsv(&encoded).unwrap();

assert_eq!(data, decoded);