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

Fields

name: String

The name of the option.

default: Option<bool>

The default value of this bool property.

The option of type check (a boolean).

Spin

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.

The option of type spin (a signed integer).

Combo

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.

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

Button

Fields

name: String

The name of the option.

The option of type button (an action).

String

Fields

name: String

The name of the option.

default: Option<String>

The default value of this string option.

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

Implementations

Returns the name of the option.

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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");

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.