fn serialize(&self) -> String {
        let mut s = format!("{}", self.get_name());
        match self {
            UciInfoAttribute::Depth(depth) => s += format!(" {}", *depth).as_str(),
            UciInfoAttribute::SelDepth(depth) => s += format!(" {}", *depth).as_str(),
            UciInfoAttribute::Time(time) => s += format!(" {}", time.num_milliseconds()).as_str(),
            UciInfoAttribute::Nodes(nodes) => s += format!(" {}", *nodes).as_str(),
            UciInfoAttribute::Pv(moves) | UciInfoAttribute::Refutation(moves) => {
                if !moves.is_empty() {
                    for m in moves {
                        s += format!(" {}", m).as_str();
                    }
                }
            },
            UciInfoAttribute::MultiPv(num) => s += format!(" {}", *num).as_str(),
            UciInfoAttribute::Score { cp, mate, lower_bound, upper_bound } => {
                if let Some(c) = cp {
                    s += format!(" cp {}", *c).as_str();
                }

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

                if lower_bound.is_some() {
                    s += " lowerbound";
                } else if upper_bound.is_some() {
                    s += " upperbound";
                }
            },
            UciInfoAttribute::CurrMove(uci_move) => s += &format!(" {}", *uci_move),
            UciInfoAttribute::CurrMoveNum(num) => s += &format!(" {}", *num),
            UciInfoAttribute::HashFull(permill) => s += &format!(" {}", *permill),
            UciInfoAttribute::Nps(nps) => s += &format!(" {}", *nps),
            UciInfoAttribute::TbHits(hits) | UciInfoAttribute::SbHits(hits) => s += &format!(" {}", *hits),
            UciInfoAttribute::CpuLoad(load) => s += &format!(" {}", *load),
            UciInfoAttribute::String(string) => s += &format!(" {}", string),
            UciInfoAttribute::CurrLine { cpu_nr, line } => {
                if let Some(c) = cpu_nr {
                    s += &format!(" cpunr {}", *c);
                }

                if !line.is_empty() {
                    for m in line {
                        s += &format!(" {}", m);
                    }
                }
            },
            UciInfoAttribute::Any(_, value) => {
                s += &format!(" {}", value);
            }
        }

        s
    }
/// Returns the attribute serialized as a String.
Returns the attribute serialized as a String.
Returns the attribute serialized as a String .
fn serialize(&self) -> String {
        let mut s = format!("{}", self.get_name());
        match self {
            UciInfoAttribute::Depth(depth) => s += format!(" {}", *depth).as_str(),
            UciInfoAttribute::SelDepth(depth) => s += format!(" {}", *depth).as_str(),
            UciInfoAttribute::Time(time) => s += format!(" {}", time.num_milliseconds()).as_str(),
            UciInfoAttribute::Nodes(nodes) => s += format!(" {}", *nodes).as_str(),
            UciInfoAttribute::Pv(moves) | UciInfoAttribute::Refutation(moves) => {
                if !moves.is_empty() {
                    for m in moves {
                        s += format!(" {}", m).as_str();
                    }
                }
            },
            UciInfoAttribute::MultiPv(num) => s += format!(" {}", *num).as_str(),
            UciInfoAttribute::Score { cp, mate, lower_bound, upper_bound } => {
                if let Some(c) = cp {
                    s += format!(" cp {}", *c).as_str();
                }
                if let Some(m) = mate {
                    s += format!(" mate {}", *m).as_str();
                }
                if lower_bound.is_some() {
                    s += " lowerbound";
                } else if upper_bound.is_some() {
                    s += " upperbound";
                }
            },
            UciInfoAttribute::CurrMove(uci_move) => s += &format!(" {}", *uci_move),
            UciInfoAttribute::CurrMoveNum(num) => s += &format!(" {}", *num),
            UciInfoAttribute::HashFull(permill) => s += &format!(" {}", *permill),
            UciInfoAttribute::Nps(nps) => s += &format!(" {}", *nps),
            UciInfoAttribute::TbHits(hits) | UciInfoAttribute::SbHits(hits) => s += &format!(" {}", *hits),
            UciInfoAttribute::CpuLoad(load) => s += &format!(" {}", *load),
            UciInfoAttribute::String(string) => s += &format!(" {}", string),
            UciInfoAttribute::CurrLine { cpu_nr, line } => {
                if let Some(c) = cpu_nr {
                    s += &format!(" cpunr {}", *c);
                }
                if !line.is_empty() {
                    for m in line {
                        s += &format!(" {}", m);
                    }
                }
            },
            UciInfoAttribute::Any(_, value) => {
                s += &format!(" {}", value);
            }
        }
        s
    }
fn serialize ( & self ) -> String { let mut s = format ! ( " " self get_name ( ) ) ; match self { UciInfoAttribute :: Depth ( depth ) => s += format ! ( " " depth ) . as_str ( ) , UciInfoAttribute :: SelDepth ( depth ) => s += format ! ( " " depth ) . as_str ( ) , UciInfoAttribute :: Time ( time ) => s += format ! ( " " time num_milliseconds ( ) ) . as_str ( ) , UciInfoAttribute :: Nodes ( nodes ) => s += format ! ( " " nodes ) . as_str ( ) , UciInfoAttribute :: Pv ( moves ) | UciInfoAttribute :: Refutation ( moves ) => { if ! moves . is_empty ( ) { for m in moves { s += format ! ( " " m ) . as_str ( ) ; } } } , UciInfoAttribute :: MultiPv ( num ) => s += format ! ( " " num ) . as_str ( ) , UciInfoAttribute :: Score { cp , mate , lower_bound , upper_bound } => { if let Some ( c ) = cp { s += format ! ( " " c ) . as_str ( ) ; } if let Some ( m ) = mate { s += format ! ( " " m ) . as_str ( ) ; } if lower_bound . is_some ( ) { s += " " ; } else if upper_bound . is_some ( ) { s += " " ; } } , UciInfoAttribute :: CurrMove ( uci_move ) => s += & format ! ( " " uci_move ) , UciInfoAttribute :: CurrMoveNum ( num ) => s += & format ! ( " " num ) , UciInfoAttribute :: HashFull ( permill ) => s += & format ! ( " " permill ) , UciInfoAttribute :: Nps ( nps ) => s += & format ! ( " " nps ) , UciInfoAttribute :: TbHits ( hits ) | UciInfoAttribute :: SbHits ( hits ) => s += & format ! ( " " hits ) , UciInfoAttribute :: CpuLoad ( load ) => s += & format ! ( " " load ) , UciInfoAttribute :: String ( string ) => s += & format ! ( " " string ) , UciInfoAttribute :: CurrLine { cpu_nr , line } => { if let Some ( c ) = cpu_nr { s += & format ! ( " " c ) ; } if ! line . is_empty ( ) { for m in line { s += & format ! ( " " m ) ; } } } , UciInfoAttribute :: Any ( _ , value ) => { s += & format ! ( " " value ) ; } } s }
Returns the attribute serialized as a String.
Returns the attribute serialized as a String .
&self