docs.rs failed to build bitcoin-bufferedfile-0.1.18
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
bitcoin-bufferedfile
bitcoin-bufferedfile is a Rust crate providing a non-refcounted RAII wrapper around a FILE* that implements a ring buffer for deserialization. It ensures the ability to rewind a given number of bytes and guarantees proper file closure when the object goes out of scope.
Overview
This crate defines a single primary type:
BufferedFile: An RAII wrapper around aFILE*that implements a ring buffer to deserialize from.
BufferedFile
The BufferedFile structure manages a FILE* pointer with a ring buffer, ensuring proper cleanup when the object is destroyed. It provides methods for reading, rewinding, and managing the read limit.
Example Usage
use BufferedFile;
use ptr;
let file_ptr: *mut FILE = unsafe ;
if file_ptr.is_null
let mut buffered_file = new;
let mut buffer = ;
buffered_file.read;
buffered_file.set_pos;
buffered_file.set_limit;
buffered_file.find_byte;
let file_ptr = buffered_file.release; // Transfer ownership
unsafe
Features
-
RAII wrapper for FILE* with automatic file closure.
-
Ring buffer implementation for efficient deserialization.
-
Methods to rewind, set read limits, and find specific bytes.
-
Ensures the ability to rewind a specified number of bytes.