Skip to content

Commit

Permalink
Update for unsupported/unknown platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
samin-cf committed Nov 2, 2024
1 parent 9dd07aa commit 509e84a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/unix/freebsd/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ impl DiskInner {
refresh_disk(self, &mut vfs)
}
}

pub(crate) fn usage(&self) -> DiskUsage {
// TODO: Until disk i/o stats are added, return the default
DiskUsage::default()
}
}

impl crate::DisksInner {
Expand All @@ -78,6 +83,12 @@ impl crate::DisksInner {
pub(crate) fn list_mut(&mut self) -> &mut [Disk] {
&mut self.disks
}

pub(crate) fn refresh(&mut self) {
for disk in self.list_mut() {
disk.refresh();
}
}
}

// FIXME: if you want to get disk I/O usage:
Expand Down
8 changes: 8 additions & 0 deletions src/unknown/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ impl DiskInner {
pub(crate) fn refresh(&mut self) -> bool {
true
}

pub(crate) fn usage(&self) -> DiskUsage {
unreachable!()
}
}

pub(crate) struct DisksInner {
Expand All @@ -65,6 +69,10 @@ impl DisksInner {
// Does nothing.
}

pub(crate) fn refresh(&mut self) {
// Does nothing.
}

pub(crate) fn list(&self) -> &[Disk] {
&self.disks
}
Expand Down

0 comments on commit 509e84a

Please sign in to comment.