file_rw
file_rw is a Rust crate for high-performance, memory-mapped file I/O utilities.
Features
- High-performance file reading and writing capabilities
- Memory-mapped files for efficient access and manipulation
- High-level, efficient abstractions of common operations on file contents
Installation
You can include the crate in your Rust project by either:
- Adding the following to your
Cargo.tomlfile:
[]
= "0.1.4"
- Run the following Cargo command to automatically do so:
Modules
file: File operationsread: File reading capabilitieswrite: File writing capabilities
Re-exports
The crate re-exports the FileReader and FileWriter structs for external use. These structs contain the aforementioned utilities.
Examples
use ;
use tempdir;
let tempdir = tempdir.unwrap;
let tempdir_path = tempdir.path;
let test_path = tempdir_path.join;
let mut writer = open;
writer.append; //Hello World!
writer.overwrite; //Hello
writer.write; //Hullo
writer.find_replace_nth; //Hulro
writer.find_replace; //Hulrooooooo
writer.find_replace_all; //Hulrddddddd
let reader = open;
let content = reader.read_to_string;
assert_eq!;