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<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 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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.