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>(position: S) -> Position
pub fn to_logical<P>(&self, scale_factor: f64) -> LogicalPosition<P>where
P: Pixel,
pub fn to_physical<P>(&self, scale_factor: f64) -> PhysicalPosition<P>where
P: Pixel,
Trait Implementations§
source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Position, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Position, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<P> From<LogicalPosition<P>> for Positionwhere
P: Pixel,
impl<P> From<LogicalPosition<P>> for Positionwhere
P: Pixel,
source§fn from(position: LogicalPosition<P>) -> Position
fn from(position: LogicalPosition<P>) -> Position
Converts to this type from the input type.
source§impl<P> From<PhysicalPosition<P>> for Positionwhere
P: Pixel,
impl<P> From<PhysicalPosition<P>> for Positionwhere
P: Pixel,
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
source§impl Serialize for Position
impl Serialize for Position
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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