typst/vendor/zerotrie
Sergey Konev a8d83b9bab
Some checks failed
Continuous integration / Tests (push) Blocked by required conditions
Continuous integration / Tests (windows-latest) (push) Waiting to run
Continuous integration / Check clippy, formatting, and documentation (push) Failing after 20s
Continuous integration / Tests (ubuntu-latest) (push) Failing after 22s
Continuous integration / Check fuzzers (push) Failing after 18s
Continuous integration / Check mininum Rust version (push) Failing after 20s
Fixed vendoring
2024-10-16 15:22:14 +03:00
..
benches Fixed vendoring 2024-10-16 15:22:14 +03:00
examples 0.11.1-alt1 2024-10-16 14:18:46 +03:00
src Fixed vendoring 2024-10-16 15:22:14 +03:00
tests Fixed vendoring 2024-10-16 15:22:14 +03:00
.cargo-checksum.json Fixed vendoring 2024-10-16 15:22:14 +03:00
Cargo.lock Fixed vendoring 2024-10-16 15:22:14 +03:00
Cargo.toml Fixed vendoring 2024-10-16 15:22:14 +03:00
LICENSE Fixed vendoring 2024-10-16 15:22:14 +03:00
README.md 0.11.1-alt1 2024-10-16 14:18:46 +03:00

zerotrie crates.io

A data structure offering zero-copy storage and retrieval of byte strings, with a focus on the efficient storage of ASCII strings. Strings are mapped to usize values.

[ZeroTrie] does not support mutation because doing so would require recomputing the entire data structure. Instead, it supports conversion to and from LiteMap and BTreeMap.

There are multiple variants of [ZeroTrie] optimized for different use cases.

Examples

use zerotrie::ZeroTrie;

let data: &[(&str, usize)] = &[("abc", 11), ("xyz", 22), ("axyb", 33)];

let trie: ZeroTrie<Vec<u8>> = data.iter().copied().collect();

assert_eq!(trie.get("axyb"), Some(33));
assert_eq!(trie.byte_len(), 18);

Internal Structure

To read about the internal structure of [ZeroTrie], build the docs with private modules:

cargo doc --document-private-items --all-features --no-deps --open

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.