fn serialize(&self) -> String {
        let mut s = String::from(format!("option name {} type {}", self.get_name(), self.get_type_str()));
        match self {
            UciOptionConfig::Check { default, .. } => {
                if let Some(def) = default {
                    s += format!(" default {}", *def).as_str();
                }
            },
            UciOptionConfig::Spin { default, min, max, .. } => {
                if let Some(def) = default {
                    s += format!(" default {}", *def).as_str();
                }

                if let Some(m) = min {
                    s += format!(" min {}", *m).as_str();
                }

                if let Some(m) = max {
                    s += format!(" max {}", *m).as_str();
                }
            }
            UciOptionConfig::Combo { default, var, .. } => {
                if let Some(def) = default {
                    s += format!(" default {}", *def).as_str();
                }

                for v in var {
                    s += format!(" var {}", *v).as_str();
                }
            }
            UciOptionConfig::String { default, .. } => {
                if let Some(def) = default {
                    s += format!(" default {}", *def).as_str();
                }
            }
            UciOptionConfig::Button { .. } => {
                // Do nothing, we're already good
            }
        }

        s
    }
/// 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");
/// ```
Serializes this option config into a full UCI message string.
Serializes this option config into a full UCI message string .
fn serialize(&self) -> String {
        let mut s = String::from(format!("option name {} type {}", self.get_name(), self.get_type_str()));
        match self {
            UciOptionConfig::Check { default, .. } => {
                if let Some(def) = default {
                    s += format!(" default {}", *def).as_str();
                }
            },
            UciOptionConfig::Spin { default, min, max, .. } => {
                if let Some(def) = default {
                    s += format!(" default {}", *def).as_str();
                }
                if let Some(m) = min {
                    s += format!(" min {}", *m).as_str();
                }
                if let Some(m) = max {
                    s += format!(" max {}", *m).as_str();
                }
            }
            UciOptionConfig::Combo { default, var, .. } => {
                if let Some(def) = default {
                    s += format!(" default {}", *def).as_str();
                }
                for v in var {
                    s += format!(" var {}", *v).as_str();
                }
            }
            UciOptionConfig::String { default, .. } => {
                if let Some(def) = default {
                    s += format!(" default {}", *def).as_str();
                }
            }
            UciOptionConfig::Button { .. } => {
                // Do nothing, we're already good
            }
        }
        s
    }
fn serialize ( & self ) -> String { let mut s = String :: from ( format ! ( " " self get_name ( ) self get_type_str ( ) ) ) ; match self { UciOptionConfig :: Check { default , .. } => { if let Some ( def ) = default { s += format ! ( " " def ) . as_str ( ) ; } } , UciOptionConfig :: Spin { default , min , max , .. } => { if let Some ( def ) = default { s += format ! ( " " def ) . as_str ( ) ; } if let Some ( m ) = min { s += format ! ( " " m ) . as_str ( ) ; } if let Some ( m ) = max { s += format ! ( " " m ) . as_str ( ) ; } } UciOptionConfig :: Combo { default , var , .. } => { if let Some ( def ) = default { s += format ! ( " " def ) . as_str ( ) ; } for v in var { s += format ! ( " " v ) . as_str ( ) ; } } UciOptionConfig :: String { default , .. } => { if let Some ( def ) = default { s += format ! ( " " def ) . as_str ( ) ; } } UciOptionConfig :: Button { .. } => { // Do nothing, we're already good } } s }
Serializes this option config into a full UCI message string.
Serializes this option config into a full UCI message string .
&self
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");
```
` ` ` 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 " ) ; ` ` `