pub enum Node<Tab> {
    Empty,
    Leaf {
        rect: Rect,
        viewport: Rect,
        tabs: Vec<Tab>,
        active: TabIndex,
    },
    Vertical {
        rect: Rect,
        fraction: f32,
    },
    Horizontal {
        rect: Rect,
        fraction: f32,
    },
}
Expand description

Represents an abstract node of a Tree.

Variants

Empty

Empty node

Leaf

Fields

rect: Rect
viewport: Rect
tabs: Vec<Tab>
active: TabIndex

Contains the actual tabs

Vertical

Fields

rect: Rect
fraction: f32

Parent node in the vertical orientation

Horizontal

Fields

rect: Rect
fraction: f32

Parent node in the horizontal orientation

Implementations

Constructs a leaf node with a given tab.

Constructs a leaf node with a given list of tabs.

Sets the area occupied by the node.

Returns true if the node is a Empty, false otherwise.

Returns true if the node is a Leaf, false otherwise.

Returns true if the node is a Horizontal, false otherwise.

Returns true if the node is a Vertical, false otherwise.

Returns true if the node is either Horizontal or Vertical, false otherwise.

Replaces the node with a Horizontal or Vertical one (depending on split) and assigns it an empty rect.

Adds a tab to the node.

Panics

Panics if the new capacity of tabs exceeds isize::MAX bytes.

Adds a tab to the node.

Panics

Panics if the new capacity of tabs exceeds isize::MAX bytes. index > tabs_count()

Removes a tab at given index from the node. Returns the removed tab if the node is a Leaf, or None otherwise.

Panics

Panics if index is out of bounds.

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 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.