Skip to main content

parse_whole_log

Function parse_whole_log 

Source
pub fn parse_whole_log(input: &str) -> Vec<GameEvent>
Expand description

Parses an entire MTG Arena Player.log string into a Vec of GameEvents.

This is a pure, synchronous function with no I/O and no async dependencies. It is suitable for use in WASM environments or any context where the file content has already been loaded into memory.

§How it works

Lines are fed through log::entry::LineBuffer to reassemble log entries, then dispatched via router::Router — the same core pipeline the async desktop path uses. A final LineBuffer::flush drains any trailing entry that was not followed by a new header.

§Example

use manasight_parser::parse_whole_log;

let input = "DETAILED LOGS: ENABLED\n";
let events = parse_whole_log(input);
assert_eq!(events.len(), 1);