pub struct ParseResult<'a> {
    pub remaining: &'a str,
    pub message: Message<'a>,
}
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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.