pub struct MasonryStyle {
pub columns: usize,
pub column_gap: f32,
pub row_gap: f32,
pub align: Align,
}Expand description
Layout style for a masonry container.
Fields§
§columns: usizeNumber of columns. Values below one are clamped to one.
column_gap: f32Gap between adjacent columns.
row_gap: f32Gap between adjacent items in the same column.
align: AlignDefault horizontal alignment of items inside their column.
Implementations§
Source§impl MasonryStyle
impl MasonryStyle
Sourcepub fn new(columns: usize) -> MasonryStyle
pub fn new(columns: usize) -> MasonryStyle
Creates a style with the given number of columns.
Sourcepub fn columns(self, columns: usize) -> MasonryStyle
pub fn columns(self, columns: usize) -> MasonryStyle
Sets the number of columns, clamped to at least one.
Sourcepub fn gap(self, gap: f32) -> MasonryStyle
pub fn gap(self, gap: f32) -> MasonryStyle
Sets both the column and row gap.
Sourcepub fn column_gap(self, gap: f32) -> MasonryStyle
pub fn column_gap(self, gap: f32) -> MasonryStyle
Sets the gap between adjacent columns.
Sourcepub fn row_gap(self, gap: f32) -> MasonryStyle
pub fn row_gap(self, gap: f32) -> MasonryStyle
Sets the gap between adjacent items in the same column.
Sourcepub fn align_items(self, align: Align) -> MasonryStyle
pub fn align_items(self, align: Align) -> MasonryStyle
Sets the default horizontal alignment of items inside their column.
Trait Implementations§
Source§impl Clone for MasonryStyle
impl Clone for MasonryStyle
Source§fn clone(&self) -> MasonryStyle
fn clone(&self) -> MasonryStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MasonryStyle
Source§impl Debug for MasonryStyle
impl Debug for MasonryStyle
Source§impl Default for MasonryStyle
impl Default for MasonryStyle
Source§fn default() -> MasonryStyle
fn default() -> MasonryStyle
Returns the “default value” for a type. Read more
Source§impl PartialEq for MasonryStyle
impl PartialEq for MasonryStyle
impl StructuralPartialEq for MasonryStyle
Auto Trait Implementations§
impl Freeze for MasonryStyle
impl RefUnwindSafe for MasonryStyle
impl Send for MasonryStyle
impl Sync for MasonryStyle
impl Unpin for MasonryStyle
impl UnsafeUnpin for MasonryStyle
impl UnwindSafe for MasonryStyle
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