| Crates.io | tlv-rs |
| lib.rs | tlv-rs |
| version | 0.3.0 |
| created_at | 2023-06-15 20:38:52.958593+00 |
| updated_at | 2025-06-10 20:29:53.350321+00 |
| description | A parser for SIMPLE TLVs. |
| homepage | |
| repository | https://github.com/Frostie314159/tlv-rs |
| max_upload_size | |
| id | 891457 |
| size | 41,997 |
A minimal parser for SIMPLE TLVs.
This crate requires allocations, because of the Cow type.
On my 12th Gen Intel 1240p Framework laptop the following speeds were achieved.
| -- | ns/iter |
|---|---|
| read_tlv | 1.37 |
| write_tlv | 2.98 |
Since the implementation only parses the header and stores the body, as a slice, all read operations are $O(1)$ and all writes $O(n)$.
In the no_panic example all functions, except for to_bytes_dynamic since it allocates and can therefore panic, are proven to never panic.