Skip to main content

UciOptionConfig

Enum UciOptionConfig 

Source
pub enum UciOptionConfig {
    Check {
        name: String,
        default: Option<bool>,
    },
    Spin {
        name: String,
        default: Option<i64>,
        min: Option<i64>,
        max: Option<i64>,
    },
    Combo {
        name: String,
        default: Option<String>,
        var: Vec<String>,
    },
    Button {
        name: String,
    },
    String {
        name: String,
        default: Option<String>,
    },
}
Expand description

Represents a UCI option definition.

Variants§

§

Check

The option of type check (a boolean).

Fields

§name: String

The name of the option.

§default: Option<bool>

The default value of this bool property.

§

Spin

The option of type spin (a signed integer).

Fields

§name: String

The name of the option.

§default: Option<i64>

The default value of this integer property.

§min: Option<i64>

The minimal value of this integer property.

§max: Option<i64>

The maximal value of this integer property.

§

Combo

The option of type combo (a list of strings).

Fields

§name: String

The name of the option.

§default: Option<String>

The default value for this list of strings.

§var: Vec<String>

The list of acceptable strings.

§

Button

The option of type button (an action).

Fields

§name: String

The name of the option.

§

String

The option of type string (a string, unsurprisingly).

Fields

§name: String

The name of the option.

§default: Option<String>

The default value of this string option.

Implementations§

Source§

impl UciOptionConfig

Source

pub fn get_name(&self) -> &str

Returns the name of the option.

Source

pub fn get_type_str(&self) -> &'static str

Returns the type string of the option (ie. "check", "spin" …)

Trait Implementations§

Source§

impl Clone for UciOptionConfig

Source§

fn clone(&self) -> UciOptionConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for UciOptionConfig

Source§

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

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

impl Display for UciOptionConfig

Source§

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

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

impl Eq for UciOptionConfig

Source§

impl Hash for UciOptionConfig

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for UciOptionConfig

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serializable for UciOptionConfig

Source§

fn serialize(&self) -> String

Serializes this option config into a full UCI message string.

§Examples
use vampirc_uci::{UciMessage, UciOptionConfig, Serializable};

let m = UciMessage::Option(UciOptionConfig::Check {
    name: String::from("Nullmove"),
    default: Some(true)
});

assert_eq!(m.serialize(), "option name Nullmove type check default true");
Source§

impl StructuralPartialEq for UciOptionConfig

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.