Skip to main content

GridLayoutBuilder

Struct GridLayoutBuilder 

Source
pub struct GridLayoutBuilder<'a> { /* private fields */ }
Expand description

Builder for a single-window pane grid.

Implementations§

Source§

impl<'a> GridLayoutBuilder<'a>

Source

pub const fn replace_existing_root_process(self, replace: bool) -> Self

Controls whether the first pane spec may replace the existing root pane process.

The default is true because newly-created app sessions already have a placeholder shell in pane 0; a command on the first declared pane is expected to replace that placeholder. Set this to false when applying a layout to an existing session should surface RmuxError::ProcessStillRunning instead of replacing the root process.

Source

pub const fn replace_existing_panes(self, replace: bool) -> Self

Allows applying the grid to a window that already contains multiple panes by closing every pane except the first listed pane before creating the requested layout.

The default is false, which keeps the builder conservative on existing workspaces. When enabled, cleanup happens before any new split is created; if cleanup fails, the builder returns that error without attempting a partial layout.

Source

pub fn pane(self, title: impl Into<String>) -> LayoutPaneBuilder<'a>

Adds one pane declaration with a UX title label.

Titles remain labels only; the returned handles are addressed by stable pane id after the layout is applied.

Source

pub async fn apply(self) -> Result<PaneSet>

Applies the grid and returns stable pane handles in declaration order.

Trait Implementations§

Source§

impl<'a> Debug for GridLayoutBuilder<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for GridLayoutBuilder<'a>

§

impl<'a> !UnwindSafe for GridLayoutBuilder<'a>

§

impl<'a> Freeze for GridLayoutBuilder<'a>

§

impl<'a> Send for GridLayoutBuilder<'a>

§

impl<'a> Sync for GridLayoutBuilder<'a>

§

impl<'a> Unpin for GridLayoutBuilder<'a>

§

impl<'a> UnsafeUnpin for GridLayoutBuilder<'a>

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