| Crates.io | csv-line |
| lib.rs | csv-line |
| version | 0.3.0 |
| created_at | 2021-11-26 15:06:50.445836+00 |
| updated_at | 2025-07-19 15:47:12.141092+00 |
| description | Fast deserialization of a single csv line |
| homepage | https://github.com/imbolc/csv-line |
| repository | https://github.com/imbolc/csv-line |
| max_upload_size | |
| id | 488061 |
| size | 30,319 |
Fast deserialization of a single CSV line.
#[derive(Debug, PartialEq, serde::Deserialize)]
struct Foo(String, i32);
assert_eq!(
csv_line::from_str::<Foo>("foo,42").unwrap(),
Foo("foo".into(), 42)
);
assert_eq!(
csv_line::from_str_sep::<Foo>("foo 42", ' ').unwrap(),
Foo("foo".into(), 42)
);
The performance is comparable to serde_json (lower is better):
test csv_builder ... bench: 13,190.73 ns/iter (+/- 793.61)
test csv_core ... bench: 12,840.18 ns/iter (+/- 633.12)
test csv_line ... bench: 176.50 ns/iter (+/- 5.15)
test serde_json ... bench: 88.24 ns/iter (+/- 2.12
The benchmark code is available here.
Please run .pre-commit.sh before submitting a pull request to ensure all checks pass.
This project is licensed under the MIT license.