pub struct MonitorHandle { /* private fields */ }
Expand description
Handle to a monitor.
Allows you to retrieve information about a given monitor and can be used in Window
creation.
Implementations§
Source§impl MonitorHandle
impl MonitorHandle
Sourcepub fn name(&self) -> Option<String>
pub fn name(&self) -> Option<String>
Returns a human-readable name of the monitor.
Returns None
if the monitor doesn’t exist anymore.
§Platform-specific
- Web: Always returns None
Sourcepub fn size(&self) -> PhysicalSize<u32>
pub fn size(&self) -> PhysicalSize<u32>
Sourcepub fn position(&self) -> PhysicalPosition<i32>
pub fn position(&self) -> PhysicalPosition<i32>
Returns the top-left corner position of the monitor relative to the larger full screen area.
§Platform-specific
- Web: Always returns (0,0)
Sourcepub fn refresh_rate_millihertz(&self) -> Option<u32>
pub fn refresh_rate_millihertz(&self) -> Option<u32>
The monitor refresh rate used by the system.
Return Some
if succeed, or None
if failed, which usually happens when the monitor
the window is on is removed.
When using exclusive fullscreen, the refresh rate of the VideoMode
that was used to
enter fullscreen should be used instead.
Sourcepub fn scale_factor(&self) -> f64
pub fn scale_factor(&self) -> f64
Sourcepub fn video_modes(&self) -> impl Iterator<Item = VideoMode>
pub fn video_modes(&self) -> impl Iterator<Item = VideoMode>
Returns all fullscreen video modes supported by this monitor.
§Platform-specific
- Web: Always returns an empty iterator
Trait Implementations§
Source§impl Clone for MonitorHandle
impl Clone for MonitorHandle
Source§fn clone(&self) -> MonitorHandle
fn clone(&self) -> MonitorHandle
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MonitorHandle
impl Debug for MonitorHandle
Source§impl Ord for MonitorHandle
impl Ord for MonitorHandle
Source§fn cmp(&self, other: &MonitorHandle) -> Ordering
fn cmp(&self, other: &MonitorHandle) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for MonitorHandle
impl PartialEq for MonitorHandle
Source§impl PartialOrd for MonitorHandle
impl PartialOrd for MonitorHandle
impl Eq for MonitorHandle
impl StructuralPartialEq for MonitorHandle
Auto Trait Implementations§
impl Freeze for MonitorHandle
impl RefUnwindSafe for MonitorHandle
impl Send for MonitorHandle
impl Sync for MonitorHandle
impl Unpin for MonitorHandle
impl UnwindSafe for MonitorHandle
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