pub struct NativeOverlayRect {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
}Expand description
Logical desktop rectangle used to select and place an overlay exactly.
Coordinates and dimensions are compositor logical pixels. Negative origins are valid for monitors left of or above the desktop origin; all components must be finite and both dimensions must be strictly positive before native creation.
§Examples
use ailloli_ui_winit::native_overlay::NativeOverlayRect;
let rect = NativeOverlayRect::new(-1920.0, 0.0, 1920.0, 1080.0);
assert_eq!((rect.x, rect.width), (-1920.0, 1920.0));Fields§
§x: f64Left edge in logical desktop coordinates.
y: f64Top edge in logical desktop coordinates.
width: f64Strictly positive logical width.
height: f64Strictly positive logical height.
Implementations§
Source§impl NativeOverlayRect
Construction and validation of a logical output rectangle.
impl NativeOverlayRect
Construction and validation of a logical output rectangle.
Sourcepub const fn new(x: f64, y: f64, width: f64, height: f64) -> Self
pub const fn new(x: f64, y: f64, width: f64, height: f64) -> Self
Creates a rectangle without validation or normalization.
Native creation later rejects non-finite coordinates and non-positive
dimensions with NativeOverlayError::InvalidTarget.
§Examples
use ailloli_ui_winit::native_overlay::NativeOverlayRect;
let rect = NativeOverlayRect::new(10.0, 20.0, 640.0, 480.0);
assert_eq!((rect.y, rect.height), (20.0, 480.0));Trait Implementations§
Source§impl Clone for NativeOverlayRect
impl Clone for NativeOverlayRect
Source§fn clone(&self) -> NativeOverlayRect
fn clone(&self) -> NativeOverlayRect
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 Debug for NativeOverlayRect
impl Debug for NativeOverlayRect
Source§impl PartialEq for NativeOverlayRect
impl PartialEq for NativeOverlayRect
impl Copy for NativeOverlayRect
impl StructuralPartialEq for NativeOverlayRect
Auto Trait Implementations§
impl Freeze for NativeOverlayRect
impl RefUnwindSafe for NativeOverlayRect
impl Send for NativeOverlayRect
impl Sync for NativeOverlayRect
impl Unpin for NativeOverlayRect
impl UnwindSafe for NativeOverlayRect
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>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.
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