Struct pane::Pane

source ·
pub struct Pane<R = [f64; 4]>where
    R: Rectangle,
{ /* private fields */ }
Expand description

A rectangle which automatically determines the positions and sizes of things withing it

A Pane can have any number of child Panes, each of which has a size constrained by their parent Pane. The size and position of each child pane depends on its weight relative to its siblings as well as the split Orientation of its parent. This allows panes to be resized while keeping all their child panes consistently sized.

A pane can also have optional contents. Contents will be resized to fit the Pane

Implementations

Create a new Pane

Immutable iterate over the Pane’s children

Mutable iterate over the Pane’s children

Get the Pane’s contents

Change the Pane’s contents

Remove the Pane’s contents

Get the Pane’s rectangle

Set the Pane’s rectangle

Get the Pane’s size

Set the Pane’s size

Get the position of the Pane’s top-left corner

Set the position of the Pane’s top-left corner

Set the Pane’s inner Panes. Each inner Pane has a weight which defines how it is resized relative to its siblings. Panes can also have optional names that can be used to index their parent.

Get the split orientation of the Pane’s children

Set the split orientation of the Pane’s children

Get the Pane’s color

Set the Pane’s color

Get the Pane’s margin

Set the Pane’s margin

Get the inner rectangle created by the Pane and its margin

Recursively fit the text of any Contents::Text in the Pane’s tree

Draw the Pane and all its contents to something using the piston2d-graphics crate

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Converts into a child Pane with a weight and optional name

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Sets value as a parameter of self.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.