Skip to main content

ContainerExt

Trait ContainerExt 

pub trait ContainerExt: LayoutExt {
    // Provided methods
    fn position(self, position: impl Into<Position>) -> Self { ... }
    fn padding(self, padding: impl Into<Gaps>) -> Self { ... }
    fn margin(self, margin: impl Into<Gaps>) -> Self { ... }
    fn min_width(self, minimum_width: impl Into<Size>) -> Self { ... }
    fn min_height(self, minimum_height: impl Into<Size>) -> Self { ... }
    fn max_width(self, maximum_width: impl Into<Size>) -> Self { ... }
    fn max_height(self, maximum_height: impl Into<Size>) -> Self { ... }
    fn visible_width(self, visible_width: impl Into<VisibleSize>) -> Self { ... }
    fn visible_height(self, visible_height: impl Into<VisibleSize>) -> Self { ... }
}
Expand description

Methods controlling an element’s position and size constraints.

Provided Methods§

fn position(self, position: impl Into<Position>) -> Self

Set how the element is placed relative to its parent or the window. See [Position].

fn padding(self, padding: impl Into<Gaps>) -> Self

Set the inner spacing between the element’s edges and its content. See [Gaps].

fn margin(self, margin: impl Into<Gaps>) -> Self

Set the outer spacing between the element’s edges and its surroundings. See [Gaps].

fn min_width(self, minimum_width: impl Into<Size>) -> Self

Set the minimum width the element can shrink to. See [Size].

fn min_height(self, minimum_height: impl Into<Size>) -> Self

Set the minimum height the element can shrink to. See [Size].

fn max_width(self, maximum_width: impl Into<Size>) -> Self

Set the maximum width the element can grow to. See [Size].

fn max_height(self, maximum_height: impl Into<Size>) -> Self

Set the maximum height the element can grow to. See [Size].

fn visible_width(self, visible_width: impl Into<VisibleSize>) -> Self

Set how much of the measured width is actually used in layout. See [VisibleSize].

fn visible_height(self, visible_height: impl Into<VisibleSize>) -> Self

Set how much of the measured height is actually used in layout. See [VisibleSize].

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ContainerExt for Canvas

Source§

impl ContainerExt for Card

Source§

impl ContainerExt for CursorArea

Source§

impl ContainerExt for DraggableCanvas

Source§

impl ContainerExt for Gif

Source§

impl ContainerExt for SelectableText

Source§

impl ContainerExt for Skeleton

Implementors§