pub enum PixelUnit {
Physical(PhysicalUnit<i32>),
Logical(LogicalUnit<f64>),
}
Expand description
A pixel unit that’s either physical or logical.
Variants§
Physical(PhysicalUnit<i32>)
Logical(LogicalUnit<f64>)
Implementations§
source§impl PixelUnit
impl PixelUnit
pub fn new<S: Into<PixelUnit>>(unit: S) -> PixelUnit
pub fn to_logical<P: Pixel>(&self, scale_factor: f64) -> LogicalUnit<P>
pub fn to_physical<P: Pixel>(&self, scale_factor: f64) -> PhysicalUnit<P>
Trait Implementations§
source§impl<P: Pixel> From<LogicalUnit<P>> for PixelUnit
impl<P: Pixel> From<LogicalUnit<P>> for PixelUnit
source§fn from(unit: LogicalUnit<P>) -> PixelUnit
fn from(unit: LogicalUnit<P>) -> PixelUnit
Converts to this type from the input type.
source§impl<P: Pixel> From<PhysicalUnit<P>> for PixelUnit
impl<P: Pixel> From<PhysicalUnit<P>> for PixelUnit
source§fn from(unit: PhysicalUnit<P>) -> PixelUnit
fn from(unit: PhysicalUnit<P>) -> PixelUnit
Converts to this type from the input type.
impl Copy for PixelUnit
impl StructuralPartialEq for PixelUnit
Auto Trait Implementations§
impl Freeze for PixelUnit
impl RefUnwindSafe for PixelUnit
impl Send for PixelUnit
impl Sync for PixelUnit
impl Unpin for PixelUnit
impl UnwindSafe for PixelUnit
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
)