Struct tiny_skia_path::ScreenIntRect
source · [−]pub struct ScreenIntRect { /* private fields */ }
Expand description
A screen IntRect
.
Guarantees
- X and Y are in 0..=i32::MAX range.
- Width and height are in 1..=i32::MAX range.
- x+width and y+height does not overflow.
Implementations
sourceimpl ScreenIntRect
impl ScreenIntRect
sourcepub fn from_xywh(x: u32, y: u32, width: u32, height: u32) -> Option<Self>
pub fn from_xywh(x: u32, y: u32, width: u32, height: u32) -> Option<Self>
Creates a new ScreenIntRect
.
sourcepub const fn from_xywh_safe(
x: u32,
y: u32,
width: NonZeroU32,
height: NonZeroU32
) -> Self
pub const fn from_xywh_safe(
x: u32,
y: u32,
width: NonZeroU32,
height: NonZeroU32
) -> Self
Creates a new ScreenIntRect
.
sourcepub fn width_safe(&self) -> NonZeroU32
pub fn width_safe(&self) -> NonZeroU32
Returns rect’s width.
sourcepub fn contains(&self, other: &Self) -> bool
pub fn contains(&self, other: &Self) -> bool
Checks that the rect is completely includes other
Rect.
sourcepub fn to_int_rect(&self) -> IntRect
pub fn to_int_rect(&self) -> IntRect
Converts into a IntRect
.
Trait Implementations
sourceimpl Clone for ScreenIntRect
impl Clone for ScreenIntRect
sourcefn clone(&self) -> ScreenIntRect
fn clone(&self) -> ScreenIntRect
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ScreenIntRect
impl Debug for ScreenIntRect
sourceimpl PartialEq<ScreenIntRect> for ScreenIntRect
impl PartialEq<ScreenIntRect> for ScreenIntRect
sourcefn eq(&self, other: &ScreenIntRect) -> bool
fn eq(&self, other: &ScreenIntRect) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ScreenIntRect) -> bool
fn ne(&self, other: &ScreenIntRect) -> bool
This method tests for !=
.
impl Copy for ScreenIntRect
impl StructuralPartialEq for ScreenIntRect
Auto Trait Implementations
impl RefUnwindSafe for ScreenIntRect
impl Send for ScreenIntRect
impl Sync for ScreenIntRect
impl Unpin for ScreenIntRect
impl UnwindSafe for ScreenIntRect
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more