pub struct SwapList(pub Vec<SwapInfo>);
Expand description
A list of parsed swap entries from /proc/swaps
.
Tuple Fields§
§0: Vec<SwapInfo>
Implementations§
Source§impl SwapList
impl SwapList
pub fn parse_from<'a, I: Iterator<Item = &'a str>>(lines: I) -> Result<SwapList>
pub fn new() -> Result<SwapList>
pub fn new_from_file<P: AsRef<Path>>(path: P) -> Result<SwapList>
pub fn new_from_reader<R: BufRead>(reader: R) -> Result<SwapList>
Sourcepub fn get_swapped(&self, path: &Path) -> bool
pub fn get_swapped(&self, path: &Path) -> bool
Returns true if the given path is a entry in the swap list.
Trait Implementations§
impl Eq for SwapList
impl StructuralPartialEq for SwapList
Auto Trait Implementations§
impl Freeze for SwapList
impl RefUnwindSafe for SwapList
impl Send for SwapList
impl Sync for SwapList
impl Unpin for SwapList
impl UnwindSafe for SwapList
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more