1 个不稳定版本
使用旧Rust 2015
0.1.0 | 2015年3月3日 |
---|
在 内存管理 中排名 #686
4KB
73 行代码(不包括注释)
rust-mmslice 
为Rust提供的内存映射文件切片(只读)。
示例
extern crate mmslice;
use std::fs::File;
use mmslice::MmapSlice;
fn main() {
if let Ok(file) = File::open("foo.txt") {
if let Ok(mmslice) = MmapSlice::new::<u8>(file, 3) {
let slice: &[u8] = mmslice.as_slice();
// ...
}
}
}