pub struct OutputMode {
pub width: u32,
pub height: u32,
pub refresh_mhz: u32,
pub preferred: bool,
pub current: bool,
}Expand description
A display mode supported by an output.
Each output can support multiple modes (resolutions and refresh rates).
Exactly one mode should be marked as current, and one as preferred.
Fields§
§width: u32Horizontal resolution in pixels
height: u32Vertical resolution in pixels
refresh_mhz: u32Refresh rate in millihertz (e.g., 60000 = 60Hz)
preferred: boolWhether this is the preferred (native) mode
current: boolWhether this is the currently active mode
Implementations§
Source§impl OutputMode
impl OutputMode
Sourcepub fn new_current_preferred(width: u32, height: u32, refresh_mhz: u32) -> Self
pub fn new_current_preferred(width: u32, height: u32, refresh_mhz: u32) -> Self
Create a mode marked as both current and preferred.
Sourcepub fn pixel_count(&self) -> u64
pub fn pixel_count(&self) -> u64
Pixel count for this mode.
Trait Implementations§
Source§impl Clone for OutputMode
impl Clone for OutputMode
Source§fn clone(&self) -> OutputMode
fn clone(&self) -> OutputMode
Returns a duplicate of the value. Read more
1.0.0§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 OutputMode
impl RefUnwindSafe for OutputMode
impl Send for OutputMode
impl Sync for OutputMode
impl Unpin for OutputMode
impl UnwindSafe for OutputMode
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)