pub struct NativeSize<P> {
pub width: P,
pub height: P,
}Expand description
A size represented in the platform’s native pixels.
This size is represented in physical pixels on Windows and Linux, and in logical pixels on macOS.
Fields§
§width: P§height: PImplementations§
Source§impl<P> NativeSize<P>
impl<P> NativeSize<P>
Sourcepub const IS_LOGICAL: bool = NATIVE_IS_LOGICAL
pub const IS_LOGICAL: bool = NATIVE_IS_LOGICAL
This is true if the platform’s native size is represented in logical pixels, and false otherwise.
This is true on macOS, and false on Windows and Linux.
pub const fn new(width: P, height: P) -> Self
Source§impl<P: Pixel> NativeSize<P>
impl<P: Pixel> NativeSize<P>
pub fn from_size(size: Size, scale_factor: f64) -> Self
pub fn cast<X: Pixel>(&self) -> NativeSize<X>
pub fn to_physical(self, scale_factor: f64) -> PhysicalSize<P>
pub fn to_logical(self, scale_factor: f64) -> LogicalSize<P>
Trait Implementations§
Source§impl<P: Clone> Clone for NativeSize<P>
impl<P: Clone> Clone for NativeSize<P>
impl<P: Copy> Copy for NativeSize<P>
Source§impl<P: Debug> Debug for NativeSize<P>
impl<P: Debug> Debug for NativeSize<P>
impl<P: Eq> Eq for NativeSize<P>
Source§impl<P: Pixel> From<NativeSize<P>> for Size
impl<P: Pixel> From<NativeSize<P>> for Size
Source§fn from(size: NativeSize<P>) -> Self
fn from(size: NativeSize<P>) -> Self
Converts to this type from the input type.
Source§impl<P: Pixel> From<WindowSize> for NativeSize<P>
impl<P: Pixel> From<WindowSize> for NativeSize<P>
Source§fn from(size: WindowSize) -> Self
fn from(size: WindowSize) -> Self
Converts to this type from the input type.
Source§impl<P: Hash> Hash for NativeSize<P>
impl<P: Hash> Hash for NativeSize<P>
Source§impl<P: PartialEq> PartialEq for NativeSize<P>
impl<P: PartialEq> PartialEq for NativeSize<P>
impl<P: PartialEq> StructuralPartialEq for NativeSize<P>
Auto Trait Implementations§
impl<P> Freeze for NativeSize<P>where
P: Freeze,
impl<P> RefUnwindSafe for NativeSize<P>where
P: RefUnwindSafe,
impl<P> Send for NativeSize<P>where
P: Send,
impl<P> Sync for NativeSize<P>where
P: Sync,
impl<P> Unpin for NativeSize<P>where
P: Unpin,
impl<P> UnsafeUnpin for NativeSize<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for NativeSize<P>where
P: UnwindSafe,
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