Crates.io | csvstream |
lib.rs | csvstream |
version | 0.2.0 |
source | src |
created_at | 2023-02-11 15:11:41.180113 |
updated_at | 2023-02-12 14:21:15.794297 |
description | Serialize and deserialize CSV streams |
homepage | |
repository | https://gitlab.com/wake-sleeper/csvstreams |
max_upload_size | |
id | 782570 |
size | 28,909 |
Deserialize CSVs, one record at a time.
use csvstream::{ByteRecord, read_csv};
let mut csv = &b"1,2\n3,4"[..];
let records = read_csv(&mut csv).collect::<Vec<ByteRecord>>();
assert_eq!(records.len(), 2);
assert_eq!(&records[0][0], b"1");
assert_eq!(&records[0][1], b"2");
assert_eq!(&records[1][0], b"3");
assert_eq!(&records[1][1], b"4");
See the docs for more info.