Struct twitch_message::ParseResult
source · Expand description
Representation of a possibly partially parse
If parse()
is called with a string that may contain multiple messages, this type will point to the start of the next messages.
let mut raw_line = ":tmi.twitch.tv PING :12345\r\n:tmi.twitch.tv PING :12346\r\n:tmi.twitch.tv PING :12347\r\n";
let res = parse(raw_line)?;
assert_eq!(res.remaining, ":tmi.twitch.tv PING :12346\r\n:tmi.twitch.tv PING :12347\r\n");
raw_line = res.remaining;
let res = parse(raw_line)?;
assert_eq!(res.remaining, ":tmi.twitch.tv PING :12347\r\n");
raw_line = res.remaining;
let res = parse(raw_line)?;
assert_eq!(res.remaining, "");
NOTE
If parse()
did not contain a \r\n
then parse()
considers it as a full message, and ParseResult::remaining
will be empty
Fields§
§remaining: &'a str
The remaining data, if any
message: Message<'a>
The parsed messages
Trait Implementations§
source§impl<'a> Clone for ParseResult<'a>
impl<'a> Clone for ParseResult<'a>
source§fn clone(&self) -> ParseResult<'a>
fn clone(&self) -> ParseResult<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more