Struct iced::widget::pane_grid::State

source ·
pub struct State<T> {
    pub panes: HashMap<Pane, T, RandomState>,
    pub internal: Internal,
    /* private fields */
}
Expand description

The state of a PaneGrid.

It keeps track of the state of each Pane and the position of each Split.

The State needs to own any mutable contents a Pane may need. This is why this struct is generic over the type T. Values of this type are provided to the view function of PaneGrid::new for displaying each Pane.

Fields§

§panes: HashMap<Pane, T, RandomState>

The panes of the PaneGrid.

§internal: Internal

The internal state of the PaneGrid.

Implementations§

Creates a new State, initializing the first pane with the provided state.

Alongside the State, it returns the first Pane identifier.

Creates a new State with the given Configuration.

Returns the total amount of panes in the State.

Returns true if the amount of panes in the State is 0.

Returns the internal state of the given Pane, if it exists.

Returns the internal state of the given Pane with mutability, if it exists.

Returns an iterator over all the panes of the State, alongside its internal state.

Returns a mutable iterator over all the panes of the State, alongside its internal state.

Returns the layout of the State.

Returns the adjacent Pane of another Pane in the given direction, if there is one.

Splits the given Pane into two in the given Axis and initializing the new Pane with the provided internal state.

Swaps the position of the provided panes in the State.

If you want to swap panes on drag and drop in your PaneGrid, you will need to call this method when handling a DragEvent.

Resizes two panes by setting the position of the provided Split.

The ratio is a value in [0, 1], representing the exact position of a Split between two panes.

If you want to enable resize interactions in your PaneGrid, you will need to call this method when handling a ResizeEvent.

Closes the given Pane and returns its internal state and its closest sibling, if it exists.

Maximize the given Pane. Only this pane will be rendered by the PaneGrid until Self::restore() is called.

Restore the currently maximized Pane to it’s normal size. All panes will be rendered by the PaneGrid.

Returns the maximized Pane of the PaneGrid.

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

Auto Trait Implementations§

Blanket Implementations§

Convert the source color to the destination color using the specified method Read more
Convert the source color to the destination color using the bradford method by default Read more
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.

Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
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
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.
Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more