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>
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