Skip to main content

StrategyKind

Enum StrategyKind 

Source
pub enum StrategyKind {
    Sequence {
        direction: Direction,
        gap: f32,
    },
    MasterStack {
        master_ratio: f32,
        gap: f32,
    },
    Deck {
        master_ratio: f32,
        gap: f32,
    },
    CenteredMaster {
        master_ratio: f32,
        gap: f32,
    },
    BinarySplit {
        spiral: bool,
        ratio: f32,
        gap: f32,
    },
    ColumnGrid {
        columns: usize,
        gap: f32,
    },
    Dashboard {
        columns: usize,
        gap: f32,
        spans: Arc<[usize]>,
    },
    ActivePanel {
        variant: ActivePanelVariant,
        bar_height: f32,
    },
    Window {
        size: usize,
        gap: f32,
    },
    Slotted {
        slots: Arc<[SlotDef]>,
        gap: f32,
        direction: Direction,
    },
}
Expand description

Behavioral strategy for a layout, determining how add/remove/move/focus mutations are applied to the tree.

Variants§

§

Sequence

Linear sequence of equal panels (split, columns).

Fields

§direction: Direction

Layout direction.

§gap: f32

Gap between panels.

§

MasterStack

One master panel with a vertical stack (master-stack).

Fields

§master_ratio: f32

Master panel’s share of the viewport (0.0–1.0).

§gap: f32

Gap between panels.

§

Deck

Master panel with a deck of one-at-a-time stack panels (deck).

Fields

§master_ratio: f32

Master panel’s share of the viewport (0.0–1.0).

§gap: f32

Gap between panels.

§

CenteredMaster

Master panel centered between two side stacks (centered-master).

Fields

§master_ratio: f32

Master panel’s share of the viewport (0.0–1.0).

§gap: f32

Gap between panels.

§

BinarySplit

Recursive binary split (dwindle, spiral).

Fields

§spiral: bool

Whether child order reverses on even-depth levels (spiral).

§ratio: f32

Split ratio at each level.

§gap: f32

Gap between panels.

§

ColumnGrid

Uniform grid of panels (grid).

Fields

§columns: usize

Number of columns.

§gap: f32

Gap between panels.

§

Dashboard

CSS-grid dashboard with per-card column spans (dashboard).

Fields

§columns: usize

Number of columns.

§gap: f32

Gap between panels.

§spans: Arc<[usize]>

Column span per card, in order.

§

ActivePanel

Only one panel visible at a time (monocle, tabbed, stacked).

Fields

§variant: ActivePanelVariant

Which sub-variant of active-panel layout.

§bar_height: f32

Height of the tab bar (tabbed) or title bars (stacked). Ignored for monocle.

§

Window

Scrollable window showing N adjacent panels (scrollable/NIRI).

Fields

§size: usize

How many panels the window shows at once.

§gap: f32

Gap between visible panels.

§

Slotted

Fixed-slot layout with named positions (sidebar, holy-grail).

Fields

§slots: Arc<[SlotDef]>

Slot definitions in layout order.

§gap: f32

Gap between slots.

§direction: Direction

Direction of the outer container.

Implementations§

Source§

impl StrategyKind

Source

pub fn gap(&self) -> f32

Gap value for this strategy.

Source

pub fn supports_move(&self) -> bool

Whether this strategy supports the move operation.

Trait Implementations§

Source§

impl Clone for StrategyKind

Source§

fn clone(&self) -> StrategyKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StrategyKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.