Examples
The Smf struct is used to store a parsed Standard Midi File (.mid and .midi files).
Notice that it has a lifetime parameter, since it stores references to the raw file bytes.
For this reason, the byte buffer must be created separately to the Smf structure:
use ;
//Load bytes into a buffer
let bytes=include_bytes!;
//Parse file in a separate step
let smf: =read.unwrap;
However, preloading into a buffer and dealing with generics can be tedious.
For this purposes, use SmfBuffer instead, which provides several parse_* non-generic methods.
use SmfBuffer;
//Load bytes into a buffer
let smf=open.unwrap;
//Parse bytes in a separate step
//When in doubt, use parse_collect!
let smf=smf.parse_collect.unwrap;
Check the documentation for SmfBuffer for more information on the different parse_* methods.