1use crate::*;
2
3#[derive(Debug, Clone)]
5pub struct Mount {
6 pub info: MountInfo,
7 pub fs_label: Option<String>,
8 pub disk: Option<Disk>,
9 pub stats: Result<Stats, StatsError>,
10 pub uuid: Option<String>,
11 pub part_uuid: Option<String>,
12}
13
14impl Mount {
15 pub fn inodes(&self) -> Option<&Inodes> {
17 self.stats
18 .as_ref()
19 .ok()
20 .and_then(|stats| stats.inodes.as_ref())
21 }
22 pub fn stats(&self) -> Option<&Stats> {
33 self.stats.as_ref().ok()
34 }
35 pub fn is_unreachable(&self) -> bool {
38 matches!(self.stats, Err(StatsError::Unreachable))
39 }
40}
41
42#[derive(Debug, Clone)]
43pub struct ReadOptions {
44 pub(crate) remote_stats: bool,
45}
46impl Default for ReadOptions {
47 fn default() -> Self {
48 Self { remote_stats: true }
49 }
50}
51impl ReadOptions {
52 pub fn remote_stats(
53 &mut self,
54 v: bool,
55 ) {
56 self.remote_stats = v;
57 }
58}