Struct tapestry::rect::Rect [−][src]
Fields
top: i32
bottom: i32
left: i32
right: i32
Implementations
impl Rect
[src]
pub fn new<C: Into<Coord>>(dimensions: C) -> Self
[src]
Constructs a Rect at (0, 0).
pub fn with_corners<C1, C2>(corner1: C1, corner2: C2) -> Self where
C1: Into<Coord>,
C2: Into<Coord>,
[src]
C1: Into<Coord>,
C2: Into<Coord>,
Constructs a Rect, given any two corners.
It is advisable to use this over creating a RectBounds literal, because
this will prevent invalid states, such as left
being less than right
.
pub fn dimensions(&self) -> Coord
[src]
pub fn offset(&self) -> Coord
[src]
pub fn area(&self) -> i32
[src]
pub fn width(&self) -> i32
[src]
pub fn height(&self) -> i32
[src]
pub fn partition_vertical(&self, partition: i32) -> (Self, Self)
[src]
pub fn partition_horizontal(&self, partition: i32) -> (Self, Self)
[src]
pub fn bsp(
&self,
orientation: Orientation,
splitter: &dyn Fn(Rect, Orientation) -> Option<(i32, Orientation)>
) -> BspTree
[src]
&self,
orientation: Orientation,
splitter: &dyn Fn(Rect, Orientation) -> Option<(i32, Orientation)>
) -> BspTree
Executes a binary space partition with the given splitter algorithm.
pub fn translate<C: Into<Coord>>(&self, coord: C) -> Self
[src]
pub fn contains<C: Into<Coord>>(&self, coord: C) -> bool
[src]
pub fn x_range(&self) -> Range<i32>
[src]
pub fn y_range(&self) -> Range<i32>
[src]
pub fn iter(&self) -> impl Iterator<Item = Coord>
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnwindSafe for Rect
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,