docs.rs failed to build bitcoin-autofile-0.1.20
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-autofile
bitcoin-autofile is a Rust crate providing a non-refcounted RAII wrapper for FILE*. It is designed to manage the lifecycle of file pointers, ensuring that files are automatically closed when they go out of scope.
Overview
This crate defines a structure:
AutoFile: An RAII wrapper forFILE*that automatically closes the file when it goes out of scope.
AutoFile
The AutoFile structure manages a FILE* pointer, ensuring proper cleanup when the object is destroyed. It provides methods for file operations and ownership management.
Example Usage
use AutoFile;
use ptr;
let file_ptr: *mut FILE = unsafe ;
if file_ptr.is_null
let mut autofile = new;
autofile.write;
let file_ptr = autofile.release; // Transfer ownership
unsafe
Features
-
RAII wrapper for FILE* to ensure automatic file closure.
-
Methods to release ownership or get the raw FILE* without releasing ownership.
-
Read, write, and ignore methods for file operations.