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

CommandResult.stdout_utf8

Borrow stdout as UTF-8 without copying or replacement.

Source and package
Qualified name
libtmux::command::CommandResult::stdout_utf8
Module
command
Declared in
CommandResult
Package
libtmux
Source
crates/libtmux/src/command.rs
pub fn stdout_utf8(&self) -> Result< &str, std::str::Utf8Error >

Description#

Errors

Returns the borrowed decoding error when stdout is not valid UTF-8.

Examples#

let server = libtmux::Server::builder().socket_path("/tmp/libtmux-rs-test/result-stdout-utf8.sock").build()?;
let result = server.cmd(libtmux::Command::new("list-sessions")).await?;
let _text = result.stdout_utf8()?;
server.shutdown().await?;
Esc

Type to search.

Reference previewOpen reference