pub enum Position {
Physical(PhysicalPosition<i32>),
Logical(LogicalPosition<f64>),
}
Expand description
A position that’s either physical or logical.
Variants§
Physical(PhysicalPosition<i32>)
Logical(LogicalPosition<f64>)
Implementations§
source§impl Position
impl Position
pub fn new<S: Into<Position>>(position: S) -> Position
pub fn to_logical<P: Pixel>(&self, scale_factor: f64) -> LogicalPosition<P>
pub fn to_physical<P: Pixel>(&self, scale_factor: f64) -> PhysicalPosition<P>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<P: Pixel> From<LogicalPosition<P>> for Position
impl<P: Pixel> From<LogicalPosition<P>> for Position
source§fn from(position: LogicalPosition<P>) -> Position
fn from(position: LogicalPosition<P>) -> Position
Converts to this type from the input type.
source§impl<P: Pixel> From<PhysicalPosition<P>> for Position
impl<P: Pixel> From<PhysicalPosition<P>> for Position
source§fn from(position: PhysicalPosition<P>) -> Position
fn from(position: PhysicalPosition<P>) -> Position
Converts to this type from the input type.
source§impl PartialEq for Position
impl PartialEq for Position
impl Copy for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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