Skip to main content

MonitorManager

Trait MonitorManager 

Source
pub trait MonitorManager: Send + Sync {
    // Required method
    fn available_monitors(&self) -> Vec<MonitorInfo>;

    // Provided methods
    fn primary_monitor(&self) -> Option<MonitorInfo> { ... }
    fn secondary_monitor(&self) -> Option<MonitorInfo> { ... }
    fn find_by_name(&self, name: &str) -> Option<MonitorInfo> { ... }
    fn find_by_selector(&self, selector: &str) -> Option<MonitorInfo> { ... }
}
Expand description

Trait for platform-specific monitor enumeration.

Separate implementations are compiled via cfg for each platform in the dais-platform crate.

Required Methods§

Source

fn available_monitors(&self) -> Vec<MonitorInfo>

Enumerate all currently connected monitors.

Provided Methods§

Source

fn primary_monitor(&self) -> Option<MonitorInfo>

Get the primary monitor, if one is designated.

Source

fn secondary_monitor(&self) -> Option<MonitorInfo>

Get a non-primary monitor (for audience display in dual mode).

Source

fn find_by_name(&self, name: &str) -> Option<MonitorInfo>

Find a monitor by name (for config-based assignment).

Source

fn find_by_selector(&self, selector: &str) -> Option<MonitorInfo>

Find a monitor by a user-facing selector.

Supported forms:

  • Exact monitor name
  • Exact monitor id
  • 1-based ordinal like “1”, “2”, “3” using the detected monitor list order

Implementors§