UciOption

Struct UciOption 

Source
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

Source

pub fn new_check(name: &str, default: bool) -> Self

Create a new UciOption of type check, with a default value.

Source

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.

Source

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.

Source

pub fn new_button(name: &str, pressed: bool) -> Self

Create a new UciOption of type button with a default state of pressed or not pressed.

Source

pub fn new_string(name: &str, default: &str) -> Self

Create a new UciOption of type string with a default value.

Source

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.

Source

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.

Source

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.

Source

pub fn button(&self) -> &Button

Assume that a UciOption is of type Button, and return reference to inner Button struct. Panics if UciOption is not Button.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn button_mut(&mut self) -> &mut Button

Assume that a UciOption is of type Button, and return reference to inner Button struct. Panics if UciOption is not Button.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for UciOption

Source§

fn clone(&self) -> UciOption

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UciOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for UciOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for UciOption

Source§

fn eq(&self, other: &UciOption) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for UciOption

Source§

impl StructuralPartialEq for UciOption

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V