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

Command.requires_tmux

Require a daemon release before dispatching this command.

Source and package
Qualified name
libtmux::command::Command::requires_tmux
Module
command
Declared in
Command
Package
libtmux
Source
crates/libtmux/src/command.rs
#[must_use = "use the returned command to retain its version requirement"] pub fn requires_tmux( mut self, capability: &'static str, needs: crate::ReleaseVersion ) -> Self

Description#

Use this when a command starts work whose later cleanup needs a newer tmux. The requirement travels with the command and its chain; refusal happens before any member runs. Repeated calls retain the higher floor.

Examples#

use libtmux::{Command, ReleaseSuffix, ReleaseVersion};
let command = Command::new("set-buffer")
.arg("-b").arg("temporary").sensitive_arg("payload")
.requires_tmux("temporary buffer cleanup",
ReleaseVersion::new(3, 4, ReleaseSuffix::FINAL));
assert_eq!(command.summary().sensitive_argument_count(), 1);
Parameters
Esc

Type to search.

Reference previewOpen reference