Skip to content

Commit

Permalink
Fix MemoryReadout doctest (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gobidev authored Jan 23, 2025
1 parent 588f12e commit 972c980
Showing 1 changed file with 15 additions and 0 deletions.
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

0 comments on commit 972c980

Please sign in to comment.