2 releases

0.1.1 Feb 13, 2025
0.1.0 Jan 22, 2025

#622 in Filesystem

Download history 96/week @ 2025-01-18 17/week @ 2025-01-25 9/week @ 2025-02-01 87/week @ 2025-02-08 27/week @ 2025-02-15

150 downloads per month

MIT license

15KB
202 lines

Reusable directory buffers.

This library implements a simple DirBuf type in order to easily perform a simple optimization: re-using a heap buffer when opening multiple files in a single dir.

consider this example:

// allocation 1
let data_dir = get_my_app_data_dir();
// allocation 2
let config_a = data_dir.join("a.conf");
// allocation 3
let config_b = data_dir.join("b.conf");
// allocation 3
let config_c = data_dir.join("c.conf");
let config_d = data_dir.join("d.conf");

Using DirBuf allows you to implement this pattern while only using a single allocation.

Dependencies

~235–680KB
~16K SLoC