pub enum WindowSize {
Physical(PhysicalSize),
Logical(LogicalSize),
}
Expand description
The size of a window represented in either physical or logical pixels. This is used
with Window::set_size
.
Variants§
Physical(PhysicalSize)
The size in physical pixels.
Logical(LogicalSize)
The size in logical screen pixels.
Implementations§
Source§impl WindowSize
impl WindowSize
Sourcepub fn to_physical(&self, scale_factor: f32) -> PhysicalSize
pub fn to_physical(&self, scale_factor: f32) -> PhysicalSize
Turn the WindowSize
into a PhysicalSize
.
Sourcepub fn to_logical(&self, scale_factor: f32) -> LogicalSize
pub fn to_logical(&self, scale_factor: f32) -> LogicalSize
Turn the WindowSize
into a LogicalSize
.
Trait Implementations§
Source§impl Clone for WindowSize
impl Clone for WindowSize
Source§fn clone(&self) -> WindowSize
fn clone(&self) -> WindowSize
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 WindowSize
impl Debug for WindowSize
Source§impl From<LogicalSize> for WindowSize
impl From<LogicalSize> for WindowSize
Source§fn from(value: LogicalSize) -> Self
fn from(value: LogicalSize) -> Self
Converts to this type from the input type.
Source§impl From<PhysicalSize> for WindowSize
impl From<PhysicalSize> for WindowSize
Source§fn from(value: PhysicalSize) -> Self
fn from(value: PhysicalSize) -> Self
Converts to this type from the input type.
Source§impl PartialEq for WindowSize
impl PartialEq for WindowSize
impl StructuralPartialEq for WindowSize
Auto Trait Implementations§
impl Freeze for WindowSize
impl RefUnwindSafe for WindowSize
impl Send for WindowSize
impl Sync for WindowSize
impl Unpin for WindowSize
impl UnwindSafe for WindowSize
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