[][src]Enum vampirc_uci::uci::UciOptionConfig

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>,
    },
}

Represents a UCI option definition.

Variants

Check

The option of type check (a boolean).

Fields of Check

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 of Spin

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 of Combo

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 of Button

name: String

The name of the option.

String

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

Fields of String

name: String

The name of the option.

default: Option<String>

The default value of this string option.

Implementations

impl UciOptionConfig[src]

pub fn get_name(&self) -> &str[src]

Returns the name of the option.

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

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

Trait Implementations

impl Clone for UciOptionConfig[src]

impl Debug for UciOptionConfig[src]

impl Display for UciOptionConfig[src]

impl Eq for UciOptionConfig[src]

impl Hash for UciOptionConfig[src]

impl PartialEq<UciOptionConfig> for UciOptionConfig[src]

impl Serializable for UciOptionConfig[src]

fn serialize(&self) -> String[src]

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

impl StructuralEq for UciOptionConfig[src]

impl StructuralPartialEq for UciOptionConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.