Crate load_buffer

Source
Expand description
// Static, backed by the array size you give it:
let mut loader: BufferedLoader<[u8; 64], _> =
    BufferedLoader::new_static(Loader::default());

// Dynamic, backed by alloc::vec::Vec<u8>:
let mut loader = BufferedLoader::new_dynamic(Loader::default(), 64);

// Dynamic can be resized.  This invalidates the buffer.
loader.resize(268435456);

// Heap, backed by alloc::boxed::Box<[u8]>:
let mut loader = BufferedLoader::new_heap(Loader::default(), 268435456);

// Heap can not be resized, but will not fill the stack for huge sizes.
// You can also supply your own buffer type, as long as it implements
// AsRef<[u8]> + AsMut<[u8]> + Debug.

Structs§

BufferedLoader
A buffering wrapper around a Load.

Traits§

Load
Like std::io::Read, but only supporting read_exact, and with an arbitrary error type.