Struct components::winit::monitor::MonitorHandle
[−]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
impl MonitorHandle
impl MonitorHandle
pub 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
pub fn size(&self) -> PhysicalSize<u32>
pub fn size(&self) -> PhysicalSize<u32>
pub 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)
pub 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
pub 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
impl Clone for MonitorHandle
impl Clone for MonitorHandle
fn clone(&self) -> MonitorHandle
fn clone(&self) -> MonitorHandle
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for MonitorHandle
impl Debug for MonitorHandle
impl MonitorHandleExtUnix for MonitorHandle
impl MonitorHandleExtUnix for MonitorHandle
impl Ord for MonitorHandle
impl Ord for MonitorHandle
impl PartialEq<MonitorHandle> for MonitorHandle
impl PartialEq<MonitorHandle> for MonitorHandle
fn eq(&self, other: &MonitorHandle) -> bool
fn eq(&self, other: &MonitorHandle) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &MonitorHandle) -> bool
fn ne(&self, other: &MonitorHandle) -> bool
This method tests for !=
.
impl PartialOrd<MonitorHandle> for MonitorHandle
impl PartialOrd<MonitorHandle> for MonitorHandle
fn partial_cmp(&self, other: &MonitorHandle) -> Option<Ordering>
fn partial_cmp(&self, other: &MonitorHandle) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
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 more
impl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
impl<T> Clamp<T> for T where
T: PartialOrd<T>,
impl<T> Clamp<T> for T where
T: PartialOrd<T>,
fn clamped(self, min: T, max: T) -> T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.