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

TmuxVersion.parse_output

Parse the exact output from tmux -V.

Source and package
Qualified name
libtmux::version::TmuxVersion::parse_output
Module
version
Declared in
TmuxVersion
Package
libtmux
Source
crates/libtmux/src/version.rs
pub fn parse_output(output: &[u8]) -> Result<Self, Error>

Description#

The output must contain one nonempty program-name token, one version token, and one trailing newline. Invalid process output is never stored in the returned error.

Errors

Returns Error::InvalidVersionOutput for malformed framing or version syntax, unsupported characters, extra lines, or invalid UTF-8.

Examples#

use libtmux::TmuxVersion;
let version = TmuxVersion::parse_output(b"tmux 3.7b\n")?;
assert_eq!(version.raw(), "3.7b");
Parameters
Esc

Type to search.

Reference previewOpen reference