pub struct ShellMetrics {
pub logical_size: Size,
pub scale_factor: f32,
}Expand description
Shell 的尺寸与 DPI。
Fields§
§logical_size: Size§scale_factor: f32物理像素 / 逻辑像素
Implementations§
Source§impl ShellMetrics
impl ShellMetrics
pub fn new(logical_size: Size, scale_factor: f32) -> ShellMetrics
Sourcepub fn from_physical(
physical_width: u32,
physical_height: u32,
scale_factor: f32,
) -> ShellMetrics
pub fn from_physical( physical_width: u32, physical_height: u32, scale_factor: f32, ) -> ShellMetrics
从物理像素尺寸与 DPR 推导逻辑尺寸。
Trait Implementations§
Source§impl Clone for ShellMetrics
impl Clone for ShellMetrics
Source§fn clone(&self) -> ShellMetrics
fn clone(&self) -> ShellMetrics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ShellMetrics
Source§impl Debug for ShellMetrics
impl Debug for ShellMetrics
Source§impl Default for ShellMetrics
impl Default for ShellMetrics
Source§fn default() -> ShellMetrics
fn default() -> ShellMetrics
Returns the “default value” for a type. Read more
Source§impl PartialEq for ShellMetrics
impl PartialEq for ShellMetrics
impl StructuralPartialEq for ShellMetrics
Auto Trait Implementations§
impl Freeze for ShellMetrics
impl RefUnwindSafe for ShellMetrics
impl Send for ShellMetrics
impl Sync for ShellMetrics
impl Unpin for ShellMetrics
impl UnsafeUnpin for ShellMetrics
impl UnwindSafe for ShellMetrics
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