| Crates.io | zswap |
| lib.rs | zswap |
| version | 1.0.3 |
| created_at | 2025-06-08 12:31:58.539703+00 |
| updated_at | 2025-06-14 15:14:04.186634+00 |
| description | Async library for accessing Zswap information in Linux |
| homepage | |
| repository | https://codeberg.org/frofor/zswap |
| max_upload_size | |
| id | 1704845 |
| size | 29,465 |
Async library for accessing Zswap information in Linux.
let enabled = zswap::param::enabled().await?;
if !enabled {
eprintln!("Zswap not enabled");
return Ok(());
}
let compressed = zswap::compressed().await?;
let uncompressed = zswap::uncompressed().await?;
let ratio = zswap::ratio().await?;
println!("Compressed size: {compressed} B");
println!("Uncompressed size: {uncompressed} B");
println!("Compression ratio: {ratio}");