options.OptionValueRefusal
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- options
- Package
- libtmux
- Source
- crates/libtmux/src/options.rs
-
Why a typed option write was refused before it reached tmux.
Carried by
crate::Error::OptionValueRefused. Never holds the value, which is treated as sensitive like every option value.Examples
use libtmux::{OptionKind, OptionValueRefusal};fn advise(refusal: &OptionValueRefusal) -> String {match refusal {OptionValueRefusal::WrongKind { expected } => format!("pass a {expected:?}"),OptionValueRefusal::NotAChoice { choices } => format!("pick one of {choices:?}"),OptionValueRefusal::OutOfRange { range } => format!("stay within {range:?}"),_ => "check the value".to_owned(),}}let refusal = OptionValueRefusal::WrongKind { expected: OptionKind::Flag };assert_eq!(advise(&refusal), "pass a Flag");
3 declared, 0 inherited
Members
- NotAChoice constant The option holds one of a fixed set of words, and the value is none of them.
- OutOfRange constant The number is outside the range the option accepts.
- WrongKind constant The value is not the variant this option reads back as: a flag needs
OptionValue::Flag, a numberOptionValue::Number, and every other kindOptionValue::Text.