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