pub struct Layout {
pub vars: LayoutVars,
pub name: Option<String>,
pub id: LayoutId,
pub hidden: bool,
/* private fields */
}Expand description
Represents a single item in the overall layout hierarchy with a bounding rectangle and an id.
Modifying any properties of this layout only stores those changes here, they won’t affect the solver until this struct is passed to the solver.
Fields§
§vars: LayoutVars§name: Option<String>§id: LayoutIdImplementations§
Source§impl Layout
impl Layout
pub fn layout(&mut self) -> &mut Self
Sourcepub fn no_container(&mut self)
pub fn no_container(&mut self)
Clears the container of the current Layout.
Sourcepub fn set_container<T>(&mut self, container: T)where
T: LayoutContainer + 'static,
pub fn set_container<T>(&mut self, container: T)where
T: LayoutContainer + 'static,
Replaces the container of the current layout. The container is what determines what constraints will be added between this layout and it’s children, as they are added, if any.
pub fn edit_left(&mut self) -> VariableEditable<'_>
pub fn edit_top(&mut self) -> VariableEditable<'_>
pub fn edit_right(&mut self) -> VariableEditable<'_>
pub fn edit_bottom(&mut self) -> VariableEditable<'_>
pub fn edit_width(&mut self) -> VariableEditable<'_>
pub fn edit_height(&mut self) -> VariableEditable<'_>
pub fn create_constraint<B: ConstraintBuilder>( &self, builder: B, ) -> Vec<Constraint>
pub fn add<B: ConstraintBuilder>(&mut self, builder: B)
pub fn remove_constraint(&mut self, constraint: Constraint)
pub fn remove_constraints(&mut self, constraints: Vec<Constraint>)
pub fn has_constraint(&mut self, constraints: &Vec<Constraint>) -> bool
pub fn get_constraints(&mut self) -> HashSet<Constraint>
pub fn get_removed_constraints(&mut self) -> Vec<Constraint>
pub fn get_edit_vars(&mut self) -> Vec<EditVariable>
pub fn add_child(&mut self, child: &mut Layout)
pub fn remove_child(&mut self, child: &mut Layout)
pub fn get_removed_children(&mut self) -> Vec<LayoutId> ⓘ
pub fn get_children(&self) -> &Vec<LayoutId> ⓘ
pub fn add_associated_vars(&mut self, vars: &LayoutVars, name: &str)
pub fn add_associated_var(&mut self, var: Variable, name: &str)
pub fn get_associated_vars(&mut self) -> Vec<(Variable, String)>
pub fn hide(&mut self)
pub fn show(&mut self)
Trait Implementations§
Source§impl<'a> LayoutRef for &'a mut Layout
impl<'a> LayoutRef for &'a mut Layout
fn layout_ref(&self) -> LayoutVars
Source§impl LayoutRef for Layout
impl LayoutRef for Layout
fn layout_ref(&self) -> LayoutVars
Auto Trait Implementations§
impl Freeze for Layout
impl !RefUnwindSafe for Layout
impl !Send for Layout
impl !Sync for Layout
impl Unpin for Layout
impl !UnwindSafe for Layout
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