//! Impls for functions gated on the "litemap" feature.
usesuper::konst::*; usecrate::builder::bytestr::ByteStr; usecrate::error::ZeroTrieBuildError; usecrate::zerotrie::ZeroTrieSimpleAscii; usecrate::ZeroTrie; use alloc::borrow::Borrow; use alloc::vec::Vec; use litemap::LiteMap;
impl<K, S> TryFrom<&LiteMap<K, usize, S>> for ZeroTrie<Vec<u8>> where // Borrow, not AsRef, because we rely on Ord being the same. Unfortunately // this means `LiteMap<&str, usize>` does not work.
K: Borrow<[u8]>,
S: litemap::store::StoreSlice<K, usize, Slice = [(K, usize)]>,
{ type Error = ZeroTrieBuildError; fn try_from(items: &LiteMap<K, usize, S>) -> Result<Self, ZeroTrieBuildError> { let byte_litemap = items.to_borrowed_keys::<[u8], Vec<_>>(); let byte_slice = byte_litemap.as_slice(); let byte_str_slice = ByteStr::from_byte_slice_with_value(byte_slice); Self::try_from_tuple_slice(byte_str_slice)
}
}
// TODO(MSRV 1.83): Make this more infallible by calculating the required length, // heap-allocating the required capacity, and pointing ConstAsciiTrieBuilderStore // to the heap buffer. // ``` // const fn write_to_mut_buffer(buf: &mut [u8]) { buf[0] = 0; } // ```
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.