Struct winit::monitor::MonitorHandle
source · [−]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
sourceimpl 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.
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
Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa.
See the dpi
module for more information.
Platform-specific
- X11: Can be overridden using the
WINIT_X11_SCALE_FACTOR
environment variable. - Android: Always returns 1.0.
- Web: Always returns 1.0
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
sourceimpl Clone for MonitorHandle
impl Clone for MonitorHandle
sourcefn clone(&self) -> MonitorHandle
fn clone(&self) -> MonitorHandle
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for MonitorHandle
impl Debug for MonitorHandle
sourceimpl MonitorHandleExtUnix for MonitorHandle
impl MonitorHandleExtUnix for MonitorHandle
sourceimpl Ord for MonitorHandle
impl Ord for MonitorHandle
sourcefn cmp(&self, other: &MonitorHandle) -> Ordering
fn cmp(&self, other: &MonitorHandle) -> Ordering
1.21.0 · sourceconst fn max(self, other: Self) -> Selfwhere
Self: Sized,
const fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Selfwhere
Self: Sized,
const fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<MonitorHandle> for MonitorHandle
impl PartialEq<MonitorHandle> for MonitorHandle
sourcefn eq(&self, other: &MonitorHandle) -> bool
fn eq(&self, other: &MonitorHandle) -> bool
sourceimpl PartialOrd<MonitorHandle> for MonitorHandle
impl PartialOrd<MonitorHandle> for MonitorHandle
sourcefn partial_cmp(&self, other: &MonitorHandle) -> Option<Ordering>
fn partial_cmp(&self, other: &MonitorHandle) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for MonitorHandle
impl StructuralEq for MonitorHandle
impl StructuralPartialEq for MonitorHandle
Auto Trait Implementations
impl !RefUnwindSafe for MonitorHandle
impl Send for MonitorHandle
impl Sync for MonitorHandle
impl Unpin for MonitorHandle
impl !UnwindSafe for MonitorHandle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more