Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-rs latest

Planner.steps_bounded

Group a plan, but never share an invocation across a boundary.

Source and package
Qualified name
libtmux::plan::planner::Planner::steps_bounded
Module
plan.planner
Declared in
Planner
Package
libtmux
Source
crates/libtmux/src/plan/planner.rs
#[must_use] pub fn steps_bounded( &self, plan: &Plan, boundaries: &BTreeSet<usize> ) -> Vec<Step>

Description#

A boundary is an index after which the caller must do something itself -- wait for a pane to be ready, run a hook -- so no group may span it. Splitting only ever breaks a group into contiguous runs, so it changes the number of invocations and not the result.

Examples#

use std::collections::BTreeSet;
use libtmux::plan::{Plan, Planner, SendKeys};
use libtmux::PaneId;
let pane: PaneId = "%1".parse()?;
let mut plan = Plan::new();
plan.add(SendKeys::new(pane.clone()).text("one").enter());
plan.add(SendKeys::new(pane).text("two").enter());
assert_eq!(Planner::Folding.steps(&plan).len(), 1);
let after_first = BTreeSet::from([0]);
assert_eq!(Planner::Folding.steps_bounded(&plan, &after_first).len(), 2);
Parameters
Esc

Type to search.

Reference previewOpen reference