pub struct UciOption {
pub name: CaselessString,
pub option_type: UciOptionType,
}
Expand description
Options to allow: option name Hash type spin default 1 min 1 max 16000 option name Clear Hash type button option name Ponder type check default false option name Threads type spin default 1 min 1 max 32
Fields§
§name: CaselessString
§option_type: UciOptionType
Implementations§
Source§impl UciOption
impl UciOption
Sourcepub fn new_check(name: &str, default: bool) -> Self
pub fn new_check(name: &str, default: bool) -> Self
Create a new UciOption of type check, with a default value.
Sourcepub fn new_spin(name: &str, default: i64, min: i64, max: i64) -> Self
pub fn new_spin(name: &str, default: i64, min: i64, max: i64) -> Self
Create a new UciOption of type spin with a default value, and a min and max.
Sourcepub fn new_combo(name: &str, default: &str, choices: &[&str]) -> Self
pub fn new_combo(name: &str, default: &str, choices: &[&str]) -> Self
Create a new UciOption of type combo with a default value and a list of choices. Default value must be a member of choices, including capitalization, but ignoring whitespace.
Create a new UciOption of type button with a default state of pressed or not pressed.
Sourcepub fn new_string(name: &str, default: &str) -> Self
pub fn new_string(name: &str, default: &str) -> Self
Create a new UciOption of type string with a default value.
Sourcepub fn check(&self) -> &Check
pub fn check(&self) -> &Check
Assume that a UciOption is of type Check, and return reference to inner Check struct. Panics if UciOption is not Check.
Sourcepub fn spin(&self) -> &Spin
pub fn spin(&self) -> &Spin
Assume that a UciOption is of type Spin, and return reference to inner Spin struct. Panics if UciOption is not Spin.
Sourcepub fn combo(&self) -> &Combo
pub fn combo(&self) -> &Combo
Assume that a UciOption is of type Combo, and return reference to inner Combo struct. Panics if UciOption is not Combo.
Assume that a UciOption is of type Button, and return reference to inner Button struct. Panics if UciOption is not Button.
Sourcepub fn string(&self) -> &UciOptionString
pub fn string(&self) -> &UciOptionString
Assume that a UciOption is of type String, and return reference to inner String struct. Panics if UciOption is not String.
Sourcepub fn check_mut(&mut self) -> &mut Check
pub fn check_mut(&mut self) -> &mut Check
Assume that a UciOption is of type Check, and return reference to inner Check struct. Panics if UciOption is not Check.
Sourcepub fn spin_mut(&mut self) -> &mut Spin
pub fn spin_mut(&mut self) -> &mut Spin
Assume that a UciOption is of type Spin, and return reference to inner Spin struct. Panics if UciOption is not Spin.
Sourcepub fn combo_mut(&mut self) -> &mut Combo
pub fn combo_mut(&mut self) -> &mut Combo
Assume that a UciOption is of type Combo, and return reference to inner Combo struct. Panics if UciOption is not Combo.
Assume that a UciOption is of type Button, and return reference to inner Button struct. Panics if UciOption is not Button.
Sourcepub fn string_mut(&mut self) -> &mut UciOptionString
pub fn string_mut(&mut self) -> &mut UciOptionString
Assume that a UciOption is of type String, and return reference to inner String struct. Panics if UciOption is not String.
Sourcepub fn try_update(&mut self, raw_opt: &RawOption) -> Result<&mut Self>
pub fn try_update(&mut self, raw_opt: &RawOption) -> Result<&mut Self>
Given a RawOption, try to extract a typed value from it’s stringly-typed value. The type of the parsed value must match the value of this UciOptionType value. This returns a mutable reference to self on successful update.