missing docs
Release / Build and Release (push) Successful in 2m54s

This commit is contained in:
2026-04-05 11:56:58 +02:00
parent 198986efac
commit f89833a62e
15 changed files with 307 additions and 38 deletions
+21
View File
@@ -1,3 +1,17 @@
//! Waybar module implementations.
//!
//! Each submodule exposes a [`WaybarModule`] type (CPU, network, audio, …)
//! and is feature-gated by a `mod-<kind>` flag. The [`WaybarModule`] trait is
//! what [`crate::registry::dispatch`] uses to evaluate a module on demand.
//!
//! Modules come in two flavours:
//!
//! * **Watched** — the daemon spawns a background polling/event task that
//! pushes state into a `watch::Receiver`, which the module reads lock-free
//! (network, cpu, audio, bluetooth, …).
//! * **Dispatch-only** — evaluated on demand only, without a watch channel
//! (power, game, btrfs).
#[cfg(feature = "mod-audio")]
pub mod audio;
#[cfg(feature = "mod-dbus")]
@@ -36,7 +50,14 @@ use crate::error::Result as FluxoResult;
use crate::output::WaybarOutput;
use crate::state::AppReceivers;
/// Common interface implemented by every Waybar module.
///
/// Given the current daemon config, the shared state receivers, and any
/// caller-supplied arguments, a module produces a single [`WaybarOutput`].
/// Implementations must be cheap to evaluate — they are invoked on every
/// client request and on every signaler state change.
pub trait WaybarModule {
/// Evaluate the module and return its rendered output.
fn run(
&self,
config: &Config,