Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix MemoryReadout doctest #183

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,21 @@ impl MemoryReadout for MacOSMemoryReadout {
// Get the currently used memory.
Ok(256 * 1024) // Return 256mb in kilobytes.
}

fn swap_total(&self) -> Result<u64, ReadoutError> {
// Get the total amount of swap.
Ok(4096 * 1024) // Return 4096mb in kilobytes.
}

fn swap_free(&self) -> Result<u64, ReadoutError> {
// Get the amount of free swap.
Ok(277 * 1024) // Return 277mb in kilobytes.
}

fn swap_used(&self) -> Result<u64, ReadoutError> {
// Get the currently used swap.
Ok(4 * 1024) // Return 4mb in kilobytes.
}
}

```
Expand Down
Loading