Crate dirbuf

Source
Expand description

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.

Structs§

DirBuf
Reusable directory buffer.
DirBufEntry
Represents an entry within a DirBuf by reusing its internal buffer.
JoinError
An error that occured while attempting to join two paths.