pub struct Layout { /* private fields */ }Expand description
A layout configuration that splits a Rect into sub-rects.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn new<I>(direction: Direction, constraints: I) -> Self
pub fn new<I>(direction: Direction, constraints: I) -> Self
Create a new layout with the given direction and constraints.
Sourcepub fn vertical<I>(constraints: I) -> Self
pub fn vertical<I>(constraints: I) -> Self
Shorthand for Layout::new with Direction::Vertical.
Sourcepub fn horizontal<I>(constraints: I) -> Self
pub fn horizontal<I>(constraints: I) -> Self
Shorthand for Layout::new with Direction::Horizontal.
Sourcepub fn constraints<I>(self, constraints: I) -> Self
pub fn constraints<I>(self, constraints: I) -> Self
Replace the current constraints.
Sourcepub fn horizontal_margin(self, margin: u16) -> Self
pub fn horizontal_margin(self, margin: u16) -> Self
Set horizontal margin (left and right).
Sourcepub fn vertical_margin(self, margin: u16) -> Self
pub fn vertical_margin(self, margin: u16) -> Self
Set vertical margin (top and bottom).
Trait Implementations§
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.