pub enum Split {
Horizontal,
Vertical,
Grid,
Fibonacci,
Dwindle,
}
Expand description
Describes different ways a crate::geometry::Rect
can be split.
Disclaimer: As it may be confusing - The terms vertical/horizontal are referring to the “splits”
not the orientation of the resulting stack. For example, Split::Horizontal
splits a rect by horizontal cuts, resulting in a “vertically stacked” list of rects.
See the variants’ documentation for clarification.
Variants§
Horizontal
Rectangle is split by horizontal
cuts.
+--------+ +--------+
| | | |
| | +--------+
| | => | |
| | +--------+
| | | |
+--------+ +--------+
Vertical
Rectangle is split by vertical
cuts.
+--------+ +--+--+--+
| | | | | |
| | | | | |
| | => | | | |
| | | | | |
| | | | | |
+--------+ +--+--+--+
Grid
Rectangle is split in a “Grid” pattern while still accounting for all of the available space, resulting in some rectangles being larger.
+-------+ +---+---+
| | | | |
| | | | |
| | => | +---+
| | | | |
| | | | |
+-------+ +---+---+
Fibonacci
Rectangle is split in a “Fibonacci” pattern.
+-------+ +---+---+
| | | | |
| | | | |
| | => | +-+-+
| | | |_| |
| | | | | |
+-------+ +---+---+
Dwindle
Rectangle is split in a “Fibonacci”-like pattern. But instead of spiraling into the middle, it spirals into the bottom right.
+-------+ +---+---+
| | | | |
| | | | |
| | => | +-+-+
| | | | |_|
| | | | |||
+-------+ +---+---+
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Split
impl<'de> Deserialize<'de> for Split
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Split
impl Eq for Split
impl StructuralPartialEq for Split
Auto Trait Implementations§
impl Freeze for Split
impl RefUnwindSafe for Split
impl Send for Split
impl Sync for Split
impl Unpin for Split
impl UnwindSafe for Split
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more