Skip to content
  • François Laignel's avatar
    Bus::get_pollfd generate doc for both unix & windows · cd56d603
    François Laignel authored and Sebastian Dröge's avatar Sebastian Dröge committed
    There are different implementations and signatures for `get_pollfd` depending
    on whether the target platform is unix or windows. When generating the doc,
    we need both implementations to appear regardless of the target platform. This
    commit is inspired by the way Rust `std` library deals with `process::Command`
    OS dependent variants
    (https://doc.rust-lang.org/std/process/struct.Command.html#impl-CommandExt).
    
    Documentation can't be accurate though as we can't use the`std::os::windows`
    on `unix` and vice versa. As a workaround a fake fd class matching the other
    platform is declared.
    
    This could be further enhanced once `#[doc(cfg(...))]` is stabilized
    (https://github.com/rust-lang/rust/issues/43781) by declaring `#[doc(cfg(unix))]`
    or `#[doc(cfg(windows))]` instead of the hard coded comments `This is supported
    on **Windows/Unix** only`. Unfortunately, these comments disappear when
    generating will `--all-features` because they are not part of the documentation
    in the gir file.
    cd56d603
This project manages its dependencies using Cargo. Learn more