pub struct DisplayInfo {
pub id: u32,
pub name: String,
pub bounds: DisplayRect,
pub work_area: DisplayRect,
pub scale_factor: f64,
pub primary: bool,
}Expand description
One display’s portable metrics.
Fields§
§id: u32Stable identifier for the display within this backend session (Win32 derives it from the device name so it survives re-enumeration).
name: StringHuman-readable device name (Win32: \\.\DISPLAY1 style).
bounds: DisplayRectFull display bounds in physical pixels.
work_area: DisplayRectWork area (bounds minus taskbar/dock reserved space).
scale_factor: f64Scale factor relative to 96 DPI (1.0, 1.25, 1.5, …).
primary: boolWhether this is the primary display.
Implementations§
Source§impl DisplayInfo
impl DisplayInfo
Sourcepub fn new(
id: u32,
name: &str,
bounds: DisplayRect,
work_area: DisplayRect,
scale_factor: f64,
primary: bool,
) -> Self
pub fn new( id: u32, name: &str, bounds: DisplayRect, work_area: DisplayRect, scale_factor: f64, primary: bool, ) -> Self
Creates display metrics.
Sourcepub fn dpi(&self) -> u32
pub fn dpi(&self) -> u32
Effective DPI derived from DisplayInfo::scale_factor.
Trait Implementations§
Source§impl Clone for DisplayInfo
impl Clone for DisplayInfo
Source§impl Debug for DisplayInfo
impl Debug for DisplayInfo
Source§impl PartialEq for DisplayInfo
impl PartialEq for DisplayInfo
impl StructuralPartialEq for DisplayInfo
Auto Trait Implementations§
impl Forget for DisplayInfo
impl Freeze for DisplayInfo
impl Move for DisplayInfo
impl RefUnwindSafe for DisplayInfo
impl Send for DisplayInfowhere
RawVecInner: Send,
impl Sync for DisplayInfowhere
RawVecInner: Sync,
impl Unpin for DisplayInfo
impl UnsafeUnpin for DisplayInfo
impl UnwindSafe for DisplayInfowhere
RawVecInner: UnwindSafe,
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