Struct rui::Region

source ·
pub struct Region<Space> { /* private fields */ }
Expand description

Region type cribbed from Druid.

Implementations§

source§

impl<Space> Region<Space>

source

pub const EMPTY: Region<Space> = _

The empty region.

source

pub fn rects(&self) -> &[Rect<f32, Space>]

Returns the collection of rectangles making up this region.

source

pub fn add_rect(&mut self, rect: Rect<f32, Space>)

Adds a rectangle to this region.

source

pub fn set_rect(&mut self, rect: Rect<f32, Space>)

Replaces this region with a single rectangle.

source

pub fn clear(&mut self)

Sets this region to the empty region.

source

pub fn bounding_box(&self) -> Rect<f32, Space>

Returns a rectangle containing this region.

source

pub fn intersects(&self, rect: Rect<f32, Space>) -> bool

Returns true if this region has a non-empty intersection with the given rectangle.

source

pub fn is_empty(&self) -> bool

Returns true if this region is empty.

source

pub fn union_with(&mut self, other: &Region<Space>)

Modifies this region by including everything in the other region.

Trait Implementations§

source§

impl<Space> AddAssign<Vector2D<f32, Space>> for Region<Space>

source§

fn add_assign(&mut self, rhs: Vector2D<f32, Space>)

Performs the += operation. Read more
source§

impl<Space: Clone> Clone for Region<Space>

source§

fn clone(&self) -> Region<Space>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Space: Debug> Debug for Region<Space>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Space> From<Rect<f32, Space>> for Region<Space>

source§

fn from(rect: Rect<f32, Space>) -> Region<Space>

Converts to this type from the input type.
source§

impl<Space> SubAssign<Vector2D<f32, Space>> for Region<Space>

source§

fn sub_assign(&mut self, rhs: Vector2D<f32, Space>)

Performs the -= operation. Read more

Auto Trait Implementations§

§

impl<Space> RefUnwindSafe for Region<Space>where Space: RefUnwindSafe,

§

impl<Space> Send for Region<Space>where Space: Send,

§

impl<Space> Sync for Region<Space>where Space: Sync,

§

impl<Space> Unpin for Region<Space>where Space: Unpin,

§

impl<Space> UnwindSafe for Region<Space>where Space: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>