Skip to content

Commit

Permalink
Doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
svartalf committed Feb 23, 2020
1 parent 7fd67c3 commit 18091c5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion heim-cpu/src/os/linux/freq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,15 @@ use crate::{sys, CpuFrequency};
///
/// [CPU frequencies]: ../../struct.CpuFrequency.html
pub fn frequencies() -> impl Stream<Item = Result<CpuFrequency>> {
sys::frequencies().map_ok(Into::into)
// TODO: Looks ugly, fix this thing.
// Problem is that we want to doc this function
// no matter for what target are we building documentation,
// but `sys::frequencies` obviously available for Linux only.
cfg_if::cfg_if! {
if #[cfg(target_os = "linux")] {
sys::frequencies().map_ok(Into::into)
} else {
stream::iter(vec![])
}
}
}
1 change: 1 addition & 0 deletions heim-net/src/os/linux/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ impl IoCountersExt for crate::IoCounters {
///
/// Implemented only for Linux for now. For other platforms will return an empty stream.
#[doc(hidden)]
#[cfg(target_os = "linux")]
pub fn io_counters_for_pid(pid: Pid) -> impl Stream<Item = Result<IoCounters>> {
sys::io_counters_for_pid(pid).map_ok(Into::into)
}
2 changes: 1 addition & 1 deletion heim-process/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async-std = "^1.5"
version-sync = "0.8"
pin-utils = "0.1.0-alpha.4"
futures-timer = "^2.0"
which = "~3.1"
which = { version = "~3.1", default-features = false }

[features]
# Polyfill runtime is enabled by default only to execute examples, tests and benchmarks.
Expand Down
1 change: 1 addition & 0 deletions heim-process/src/os/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub trait ProcessExt {
/// this method returns boxed `Stream`. This behavior will change later.
///
/// [IO counters]: ./struct.IoCounters.html
#[cfg(target_os = "linux")] // TODO: will be undocumented for other platforms
fn net_io_counters(&self) -> BoxStream<ProcessResult<heim_net::IoCounters>>;
}

Expand Down

0 comments on commit 18091c5

Please sign in to comment.