pub struct MonitorInfo {
pub id: String,
pub name: String,
pub position: (i32, i32),
pub size: (u32, u32),
pub work_area: (i32, i32, u32, u32),
pub scale_factor: f64,
pub is_primary: bool,
}Expand description
Information about a connected display monitor.
Fields§
§id: StringUnique identifier for this monitor (platform-specific).
name: StringHuman-readable name (e.g., “DELL U2718Q”).
position: (i32, i32)Position on the virtual desktop, top-left corner (pixels).
size: (u32, u32)Physical resolution (width, height in pixels).
work_area: (i32, i32, u32, u32)Usable work area on the virtual desktop, excluding taskbars/docks where the platform can provide it. Stored as (x, y, width, height) in physical pixels.
scale_factor: f64DPI scale factor (1.0 = 96dpi, 2.0 = Retina/HiDPI).
is_primary: boolWhether this is the OS primary monitor.
Implementations§
Source§impl MonitorInfo
impl MonitorInfo
Sourcepub fn logical_size(&self) -> (f64, f64)
pub fn logical_size(&self) -> (f64, f64)
The effective logical size (physical size / scale factor).
Trait Implementations§
Source§impl Clone for MonitorInfo
impl Clone for MonitorInfo
Source§fn clone(&self) -> MonitorInfo
fn clone(&self) -> MonitorInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MonitorInfo
impl RefUnwindSafe for MonitorInfo
impl Send for MonitorInfo
impl Sync for MonitorInfo
impl Unpin for MonitorInfo
impl UnsafeUnpin for MonitorInfo
impl UnwindSafe for MonitorInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more