Crates.io | mkswap |
lib.rs | mkswap |
version | 0.1.1 |
source | src |
created_at | 2022-07-03 18:47:24.985715 |
updated_at | 2022-10-12 16:39:53.712237 |
description | Create a swap file or device in pure Rust. |
homepage | https://github.com/grahamc/mkswap |
repository | https://github.com/grahamc/mkswap |
max_upload_size | |
id | 618503 |
size | 12,082 |
Initialize a swap device or file in Rust.
For example:
```rust
use std::io::Cursor;
use mkswap::SwapWriter;
let mut buffer: Cursor<Vec<u8>> = Cursor::new(vec![0; 40 * 1024]);
let size = SwapWriter::new()
.label("🔀".into())
.unwrap()
.write(&mut buffer)
.unwrap();