pub struct LayoutEngine {
pub compactor: Box<dyn Compactor>,
pub collision: Box<dyn CollisionResolver>,
pub cols: i32,
}Expand description
The main orchestration point for grid operations.
Fields§
§compactor: Box<dyn Compactor>The compaction strategy to use.
collision: Box<dyn CollisionResolver>Displacement policy after overlaps.
cols: i32The number of columns in the grid.
Implementations§
Source§impl LayoutEngine
impl LayoutEngine
pub fn new( compactor: Box<dyn Compactor>, collision: Box<dyn CollisionResolver>, cols: i32, ) -> Self
Sourcepub fn with_default_collision(compactor: Box<dyn Compactor>, cols: i32) -> Self
pub fn with_default_collision(compactor: Box<dyn Compactor>, cols: i32) -> Self
Gravity compaction with push-down collision resolution.
pub fn compact(&self, layout: &mut Vec<LayoutItem>)
pub fn move_element( &self, layout: &mut Vec<LayoutItem>, id: &str, x: i32, y: i32, )
pub fn resize_element( &self, layout: &mut Vec<LayoutItem>, id: &str, x: i32, y: i32, w: i32, h: i32, handle: Option<ResizeHandle>, )
Auto Trait Implementations§
impl Freeze for LayoutEngine
impl !RefUnwindSafe for LayoutEngine
impl !Send for LayoutEngine
impl !Sync for LayoutEngine
impl Unpin for LayoutEngine
impl UnsafeUnpin for LayoutEngine
impl !UnwindSafe for LayoutEngine
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