Function collect_str_in_arena0

Source
fn collect_str_in_arena0(iter: impl Iterator<Item = char>) -> &'static str
Expand description

Converts an iterator of characters into a static string stored in a memory arena.

This function uses a thread-local arena to safely collect characters from an iterator into a BString, a specialized string container. The collec_in method is invoked with an unsafe context to ensure that memory allocation aligns properly within the arena’s boundaries. The function ultimately returns a static string reference derived from converting the BString into a bump-allocated string, ensuring efficient memory usage and lifetime management through the arena while retaining a ’static lifetime.