Struct vault::Vault
[−]
[src]
pub struct Vault { pub replays: Vec<Replay>, }
This type is the main entry point for the vault replay parser and provides the cleanest interface for use by external code.
Fields
replays: Vec<Replay>
Methods
impl Vault
[src]
fn parse(path: &Path) -> Result<Vault>
Attempts to parse the given file, returning a Vault type populated with the Replay(s) if successful.
Currently .rec and .zip (archives) are supported filetypes. When an archive is provided, all .rec files in the archive will be parsed. All resulting Replays have their raw byte data cleaned automatically after parse completes, and cannot be mutated.
Examples
extern crate vault; use vault::Vault; use std::path::Path; let path = Path::new("/path/to/file"); let results = Vault::parse(&path).unwrap(); for replay in results.replays().iter() { println!("{}", replay.to_json()); }
fn to_json(&self) -> Result<String>
Serializes Vault as JSON String.