Struct tiny_skia::IntRect[][src]

pub struct IntRect { /* fields omitted */ }

An integer rectangle.

Guarantees

  • Width and height are in 1..=i32::MAX range.
  • x+width and y+height does not overflow.

Implementations

impl IntRect[src]

pub fn from_xywh(x: i32, y: i32, width: u32, height: u32) -> Option<Self>[src]

Creates a new IntRect.

pub fn from_ltrb(left: i32, top: i32, right: i32, bottom: i32) -> Option<Self>[src]

Creates a new IntRect.

pub fn x(&self) -> i32[src]

Returns rect’s X position.

pub fn y(&self) -> i32[src]

Returns rect’s Y position.

pub fn width(&self) -> u32[src]

Returns rect’s width.

pub fn height(&self) -> u32[src]

Returns rect’s height.

pub fn left(&self) -> i32[src]

Returns rect’s left edge.

pub fn top(&self) -> i32[src]

Returns rect’s top edge.

pub fn right(&self) -> i32[src]

Returns rect’s right edge.

pub fn bottom(&self) -> i32[src]

Returns rect’s bottom edge.

pub fn to_rect(&self) -> Rect[src]

Converts into Rect.

Trait Implementations

impl Clone for IntRect[src]

impl Copy for IntRect[src]

impl Debug for IntRect[src]

impl PartialEq<IntRect> for IntRect[src]

impl StructuralPartialEq for IntRect[src]

Auto Trait Implementations

impl RefUnwindSafe for IntRect

impl Send for IntRect

impl Sync for IntRect

impl Unpin for IntRect

impl UnwindSafe for IntRect

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.