[][src]Trait vampirc_uci::uci::Serializable

pub trait Serializable: Display {
    fn serialize(&self) -> String;
}

Required methods

fn serialize(&self) -> String

Loading content...

Implementors

impl Serializable for UciInfoAttribute[src]

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

Returns the attribute serialized as a String.

impl Serializable for UciMessage[src]

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

Serializes the command into a String.

Examples

use vampirc_uci::{UciMessage, Serializable};

println!("{}", UciMessage::Uci.serialize()); // Should print `uci`.

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");
Loading content...