pub struct ScreenSize { /* private fields */ }
Expand description
ScreenSize
represents a size on the screen. It can be created from pixels, pips, or
millimeters and can be retrieved in any of those units.
Implementations§
Source§impl ScreenSize
impl ScreenSize
Sourcepub fn from_pixels(
width: f32,
height: f32,
display_metrics: DisplayMetrics,
) -> Self
pub fn from_pixels( width: f32, height: f32, display_metrics: DisplayMetrics, ) -> Self
Create a ScreenSize
from the given pixel corrdinates
Sourcepub fn from_pips(
width: f32,
height: f32,
display_metrics: DisplayMetrics,
) -> Self
pub fn from_pips( width: f32, height: f32, display_metrics: DisplayMetrics, ) -> Self
Create a ScreenSize
from the given pip corrdinates
Sourcepub fn from_mm(width: f32, height: f32, display_metrics: DisplayMetrics) -> Self
pub fn from_mm(width: f32, height: f32, display_metrics: DisplayMetrics) -> Self
Create a ScreenSize
from the given millimeter corrdinates
Sourcepub fn from_size(size: &Size, display_metrics: DisplayMetrics) -> Self
pub fn from_size(size: &Size, display_metrics: DisplayMetrics) -> Self
This takes a Position struct and maps it to ScreenSize
Trait Implementations§
Source§impl Clone for ScreenSize
impl Clone for ScreenSize
Source§fn clone(&self) -> ScreenSize
fn clone(&self) -> ScreenSize
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 ScreenSize
impl Debug for ScreenSize
impl Copy for ScreenSize
Auto Trait Implementations§
impl Freeze for ScreenSize
impl RefUnwindSafe for ScreenSize
impl Send for ScreenSize
impl Sync for ScreenSize
impl Unpin for ScreenSize
impl UnwindSafe for ScreenSize
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)