[][src]Function vampirc_uci::parser::parse

pub fn parse(s: &str) -> MessageList

Parses the specified &str s into a list of UciMessages. Please note that this method will ignore any unrecognized messages, which is in-line with the recommendations of the UCI protocol specification.

The UCI messages are separated by a newline character, as per the UCI protocol specification.

This method differs from the parse_strict(..) method in the fact that any unrecognized tokens/messages will simply be ignored.

Examples

use vampirc_uci::UciMessage;
use vampirc_uci::parse;

let messages = parse("position startpos\n  unknown message that will be ignored  \ngo infinite\n");
assert_eq!(messages.len(), 2);