1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! The parser module provides all the different parsers available for parsing
//! splits files into Runs. If the file type of the splits file is not known,
//! the composite parser can be used, which tries to figure out which splits
//! file format is used and parses it with the parser for that format.
//!
//! # Examples
//!
//! Using the composite parser to parse a splits file of an unknown file format.
//!
//! ```no_run
//! use livesplit_core::run::parser::composite;
//! use std::fs;
//! use std::path::Path;
//!
//! // Load the file.
//! let path = Path::new("path/to/splits_file");
//! let file = fs::read(path).expect("Failed reading the file.");
//!
//! // Actually parse the file. We also pass the path to load additional files from
//! // the file system, like segment icons.
//! let result = composite::parse(&file, Some(path));
//! let parsed = result.expect("Not a valid splits file.");
//!
//! // Print out the detected file format.
//! println!("Splits File Format: {}", parsed.kind);
//!
//! // Get out the Run object.
//! let run = parsed.run;
//! ```
pub use TimerKind;
pub use ;