[][src]Enum webrender_api::DirtyRect

pub enum DirtyRect<T: Copy, U> {
    All,
    Partial(TypedRect<T, U>),
}

The possible states of a Dirty rect.

This exists because people kept getting confused with Option<Rect>.

Variants

All

Everything is Dirty, equivalent to Partial(image_bounds)

Partial(TypedRect<T, U>)

Some specific amount is dirty

Methods

impl<T, U> DirtyRect<T, U> where
    T: Copy + Clone + PartialOrd + PartialEq + Add<T, Output = T> + Sub<T, Output = T> + Zero
[src]

pub fn empty() -> Self[src]

Creates an empty DirtyRect (indicating nothing is invalid)

pub fn is_empty(&self) -> bool[src]

Returns whether the dirty rect is empty

pub fn replace_with_empty(&mut self) -> Self[src]

Replaces self with the empty rect and returns the old value.

pub fn map<F>(self, func: F) -> Self where
    F: FnOnce(TypedRect<T, U>) -> TypedRect<T, U>, 
[src]

Maps over the contents of Partial.

pub fn union(&self, other: &Self) -> Self[src]

Unions the dirty rects.

pub fn intersection(&self, other: &Self) -> Self[src]

Intersects the dirty rects.

pub fn to_subrect_of(&self, rect: &TypedRect<T, U>) -> TypedRect<T, U>[src]

Converts the dirty rect into a subrect of the given one via intersection.

Trait Implementations

impl<T: Copy, U> Clone for DirtyRect<T, U>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Copy, U> From<TypedRect<T, U>> for DirtyRect<T, U>[src]

impl<T: Copy, U> Copy for DirtyRect<T, U>[src]

impl<T: Debug + Copy, U: Debug> Debug for DirtyRect<T, U>[src]

impl<'de, T: Copy, U> Deserialize<'de> for DirtyRect<T, U> where
    T: Deserialize<'de>,
    U: Deserialize<'de>, 
[src]

impl<T: Copy, U> Serialize for DirtyRect<T, U> where
    T: Serialize,
    U: Serialize
[src]

Auto Trait Implementations

impl<T, U> Send for DirtyRect<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for DirtyRect<T, U> where
    T: Sync,
    U: Sync

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]