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.toml
file:
[]
= "0.3.1"
- 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; //Huylo
writer.find_replace; //Heylo
writer.find_replace; //Heyyyy
writer.find_replace_all; //Heiiii
writer.find_replace; //Hiiiii
let reader = writer.to_reader;
let content = reader.read_to_string;
assert_eq!;