[−][src]Trait i3status_rs::blocks::ConfigBlock
The ConfigBlock trait combines a constructor (new(...)) and an associated configuration type to form a block that can be instantiated from a piece of TOML (from the block configuration). The associated type has to be a deserializable struct, which you can then use to get your configurations from. The template shows you how to instantiate a simple Text widget. For more info on how to use widgets, just look into other Blocks. More documentation to come.
The sender object can be used to send asynchronous update request for any block from a separate thread, provide you know the Block's ID. This advanced feature can be used to reduce the number of system calls by asynchronously waiting for events. A usage example can be found in the Music block, which updates only when dbus signals a new song.
Associated Types
Loading content...Required methods
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
update_request: Sender<Task>
) -> Result<Self, Error> where
Self: Sized,
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
update_request: Sender<Task>
) -> Result<Self, Error> where
Self: Sized,
Creates a new block from the relevant configuration.
Provided methods
fn override_on_click(&mut self) -> Option<&mut Option<String>>
[src]
TODO: write documentation
Implementors
impl ConfigBlock for Apt
[src]
type Config = AptConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Backlight
[src]
type Config = BacklightConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Battery
[src]
type Config = BatteryConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Bluetooth
[src]
type Config = BluetoothConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Cpu
[src]
type Config = CpuConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Custom
[src]
type Config = CustomConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx: Sender<Task>
) -> Result<Self, Error>
fn override_on_click(&mut self) -> Option<&mut Option<String>>
[src]
impl ConfigBlock for CustomDBus
[src]
type Config = CustomDBusConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for DiskSpace
[src]
type Config = DiskSpaceConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Docker
[src]
type Config = DockerConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for FocusedWindow
[src]
type Config = FocusedWindowConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Github
[src]
type Config = GithubConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Hueshift
[src]
type Config = HueshiftConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for IBus
[src]
type Config = IBusConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for KDEConnect
[src]
type Config = KDEConnectConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for KeyboardLayout
[src]
type Config = KeyboardLayoutConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Load
[src]
type Config = LoadConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Memory
[src]
type Config = MemoryConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Music
[src]
type Config = MusicConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
fn override_on_click(&mut self) -> Option<&mut Option<String>>
[src]
impl ConfigBlock for Net
[src]
type Config = NetConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for NetworkManager
[src]
type Config = NetworkManagerConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Notify
[src]
type Config = NotifyConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
send: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for NvidiaGpu
[src]
type Config = NvidiaGpuConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Pacman
[src]
type Config = PacmanConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Pomodoro
[src]
type Config = PomodoroConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_send: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_send: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Sound
[src]
type Config = SoundConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx_update_request: Sender<Task>
) -> Result<Self, Error>
fn override_on_click(&mut self) -> Option<&mut Option<String>>
[src]
impl ConfigBlock for SpeedTest
[src]
type Config = SpeedTestConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
done: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
done: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Taskwarrior
[src]
type Config = TaskwarriorConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Temperature
[src]
type Config = TemperatureConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Template
[src]
type Config = TemplateConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Time
[src]
type Config = TimeConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Toggle
[src]
type Config = ToggleConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Uptime
[src]
type Config = UptimeConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Watson
[src]
type Config = WatsonConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Weather
[src]
type Config = WeatherConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
impl ConfigBlock for Xrandr
[src]
type Config = XrandrConfig
fn new(
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>
[src]
id: usize,
block_config: Self::Config,
shared_config: SharedConfig,
_tx_update_request: Sender<Task>
) -> Result<Self, Error>