From ecb96598c6c6218966ffa56490fd6d0cffea80d9 Mon Sep 17 00:00:00 2001 From: Adrian Groh Date: Wed, 22 Jan 2025 21:16:02 +0100 Subject: [PATCH] Fix MemoryReadout doctest --- src/traits.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/traits.rs b/src/traits.rs index f3071c0..dbf1475 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -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 { + // Get the total amount of swap. + Ok(4096 * 1024) // Return 4096mb in kilobytes. + } + + fn swap_free(&self) -> Result { + // Get the amount of free swap. + Ok(277 * 1024) // Return 277mb in kilobytes. + } + + fn swap_used(&self) -> Result { + // Get the currently used swap. + Ok(4 * 1024) // Return 4mb in kilobytes. + } } ```