Struct dpi::PhysicalUnit
source · pub struct PhysicalUnit<P>(pub P);
Expand description
A physical pixel unit.
Tuple Fields§
§0: P
Implementations§
source§impl<P> PhysicalUnit<P>
impl<P> PhysicalUnit<P>
sourcepub const MIN: LogicalUnit<f64> = _
pub const MIN: LogicalUnit<f64> = _
Represents a minimum physical unit of f64::MAX
.
sourcepub const ZERO: LogicalUnit<f64> = _
pub const ZERO: LogicalUnit<f64> = _
Represents a physical unit of 0_f64
.
sourcepub const MAX: LogicalUnit<f64> = _
pub const MAX: LogicalUnit<f64> = _
Represents a maximum physical unit that is equal to f64::MAX
.
pub const fn new(v: P) -> Self
source§impl<P: Pixel> PhysicalUnit<P>
impl<P: Pixel> PhysicalUnit<P>
pub fn from_logical<T: Into<LogicalUnit<X>>, X: Pixel>( logical: T, scale_factor: f64, ) -> Self
pub fn to_logical<X: Pixel>(&self, scale_factor: f64) -> LogicalUnit<X>
pub fn cast<X: Pixel>(&self) -> PhysicalUnit<X>
Trait Implementations§
source§impl<P: Clone> Clone for PhysicalUnit<P>
impl<P: Clone> Clone for PhysicalUnit<P>
source§fn clone(&self) -> PhysicalUnit<P>
fn clone(&self) -> PhysicalUnit<P>
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<P: Debug> Debug for PhysicalUnit<P>
impl<P: Debug> Debug for PhysicalUnit<P>
source§impl<P: Default> Default for PhysicalUnit<P>
impl<P: Default> Default for PhysicalUnit<P>
source§fn default() -> PhysicalUnit<P>
fn default() -> PhysicalUnit<P>
Returns the “default value” for a type. Read more
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.
source§impl<P: Pixel> From<PhysicalUnit<P>> for f32
impl<P: Pixel> From<PhysicalUnit<P>> for f32
source§fn from(v: PhysicalUnit<P>) -> f32
fn from(v: PhysicalUnit<P>) -> f32
Converts to this type from the input type.
source§impl<P: Pixel> From<PhysicalUnit<P>> for f64
impl<P: Pixel> From<PhysicalUnit<P>> for f64
source§fn from(v: PhysicalUnit<P>) -> f64
fn from(v: PhysicalUnit<P>) -> f64
Converts to this type from the input type.
source§impl<P: Pixel> From<PhysicalUnit<P>> for i16
impl<P: Pixel> From<PhysicalUnit<P>> for i16
source§fn from(v: PhysicalUnit<P>) -> i16
fn from(v: PhysicalUnit<P>) -> i16
Converts to this type from the input type.
source§impl<P: Pixel> From<PhysicalUnit<P>> for i32
impl<P: Pixel> From<PhysicalUnit<P>> for i32
source§fn from(v: PhysicalUnit<P>) -> i32
fn from(v: PhysicalUnit<P>) -> i32
Converts to this type from the input type.
source§impl<P: Pixel> From<PhysicalUnit<P>> for i8
impl<P: Pixel> From<PhysicalUnit<P>> for i8
source§fn from(v: PhysicalUnit<P>) -> i8
fn from(v: PhysicalUnit<P>) -> i8
Converts to this type from the input type.
source§impl<P: Pixel> From<PhysicalUnit<P>> for u16
impl<P: Pixel> From<PhysicalUnit<P>> for u16
source§fn from(v: PhysicalUnit<P>) -> u16
fn from(v: PhysicalUnit<P>) -> u16
Converts to this type from the input type.
source§impl<P: Pixel> From<PhysicalUnit<P>> for u32
impl<P: Pixel> From<PhysicalUnit<P>> for u32
source§fn from(v: PhysicalUnit<P>) -> u32
fn from(v: PhysicalUnit<P>) -> u32
Converts to this type from the input type.
source§impl<P: Pixel> From<PhysicalUnit<P>> for u8
impl<P: Pixel> From<PhysicalUnit<P>> for u8
source§fn from(v: PhysicalUnit<P>) -> u8
fn from(v: PhysicalUnit<P>) -> u8
Converts to this type from the input type.
source§impl<P: Pixel, X: Pixel> From<X> for PhysicalUnit<P>
impl<P: Pixel, X: Pixel> From<X> for PhysicalUnit<P>
source§fn from(v: X) -> PhysicalUnit<P>
fn from(v: X) -> PhysicalUnit<P>
Converts to this type from the input type.
source§impl<P: Hash> Hash for PhysicalUnit<P>
impl<P: Hash> Hash for PhysicalUnit<P>
source§impl<P: Ord> Ord for PhysicalUnit<P>
impl<P: Ord> Ord for PhysicalUnit<P>
source§fn cmp(&self, other: &PhysicalUnit<P>) -> Ordering
fn cmp(&self, other: &PhysicalUnit<P>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<P: PartialEq> PartialEq for PhysicalUnit<P>
impl<P: PartialEq> PartialEq for PhysicalUnit<P>
source§impl<P: PartialOrd> PartialOrd for PhysicalUnit<P>
impl<P: PartialOrd> PartialOrd for PhysicalUnit<P>
impl<P: Copy> Copy for PhysicalUnit<P>
impl<P: Eq> Eq for PhysicalUnit<P>
impl<P> StructuralPartialEq for PhysicalUnit<P>
Auto Trait Implementations§
impl<P> Freeze for PhysicalUnit<P>where
P: Freeze,
impl<P> RefUnwindSafe for PhysicalUnit<P>where
P: RefUnwindSafe,
impl<P> Send for PhysicalUnit<P>where
P: Send,
impl<P> Sync for PhysicalUnit<P>where
P: Sync,
impl<P> Unpin for PhysicalUnit<P>where
P: Unpin,
impl<P> UnwindSafe for PhysicalUnit<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
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
)