sawp_file/
lib.rs

1//! SAWP File Format
2//!
3//! This module defines structs to serialize and deserialize arguments to SAWP
4//! calls in order to replay them into a parser.
5
6extern crate serde;
7
8#[macro_use]
9extern crate serde_derive;
10extern crate rmp_serde as rmps;
11
12pub mod error;
13pub mod format;
14
15pub type Version = usize;
16
17/// Get the version number of the format
18pub fn version() -> Version {
19    // This should never fail because the compiler sets the environment variable.
20    // There doesn't seem to be a "const fn" version of the parse function.
21    env!("CARGO_PKG_VERSION_MAJOR")
22        .parse()
23        .expect("failed to parse version number")
24}