Enum WindowPosition
pub enum WindowPosition {
Physical(PhysicalPosition),
Logical(LogicalPosition),
}
Expand description
The position of the window in either physical or logical pixels. This is used
with Window::set_position
.
Variants§
Physical(PhysicalPosition)
The position in physical pixels.
Logical(LogicalPosition)
The position in logical pixels.
Implementations§
§impl WindowPosition
impl WindowPosition
pub fn to_physical(&self, scale_factor: f32) -> PhysicalPosition
pub fn to_physical(&self, scale_factor: f32) -> PhysicalPosition
Turn the WindowPosition
into a PhysicalPosition
.
Trait Implementations§
§impl Clone for WindowPosition
impl Clone for WindowPosition
§fn clone(&self) -> WindowPosition
fn clone(&self) -> WindowPosition
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 more§impl Debug for WindowPosition
impl Debug for WindowPosition
§impl From<LogicalPosition> for WindowPosition
impl From<LogicalPosition> for WindowPosition
§fn from(value: LogicalPosition) -> WindowPosition
fn from(value: LogicalPosition) -> WindowPosition
Converts to this type from the input type.
§impl From<PhysicalPosition> for WindowPosition
impl From<PhysicalPosition> for WindowPosition
§fn from(value: PhysicalPosition) -> WindowPosition
fn from(value: PhysicalPosition) -> WindowPosition
Converts to this type from the input type.
§impl PartialEq for WindowPosition
impl PartialEq for WindowPosition
impl StructuralPartialEq for WindowPosition
Auto Trait Implementations§
impl Freeze for WindowPosition
impl RefUnwindSafe for WindowPosition
impl Send for WindowPosition
impl Sync for WindowPosition
impl Unpin for WindowPosition
impl UnwindSafe for WindowPosition
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more