pub fn parse_swf(swf_buf: &SwfBuf) -> Result<Swf<'_>> {
    let mut reader = Reader::new(&swf_buf.data[..], swf_buf.header.version);

    Ok(Swf {
        header: swf_buf.header.clone(),
        tags: reader.read_tag_list()?,
    })
}
/// Parse a decompressed SWF and return a `Vec` of tags.
///
/// # Example
/// ```
/// # std::env::set_current_dir(env!("CARGO_MANIFEST_DIR"));
/// let data = std::fs::read("tests/swfs/DefineSprite.swf").unwrap();
/// let stream = swf::decompress_swf(&data[..]).unwrap();
/// let swf = swf::parse_swf(&stream).unwrap();
/// println!("Number of frames: {}", swf.header.num_frames);
/// ```
Parse a decompressed SWF and return a `Vec` of tags.
Parse a decompressed SWF and return a ` Vec ` of tags .
pub fn parse_swf(swf_buf: &SwfBuf) -> Result<Swf<'_>> {
    let mut reader = Reader::new(&swf_buf.data[..], swf_buf.header.version);
    Ok(Swf {
        header: swf_buf.header.clone(),
        tags: reader.read_tag_list()?,
    })
}
pub fn parse_swf ( swf_buf : & SwfBuf ) -> Result < Swf < ' _ > > { let mut reader = Reader :: new ( & swf_buf . data [ .. ] , swf_buf . header . version ) ; Ok ( Swf { header : swf_buf . header . clone ( ) , tags : reader . read_tag_list ( ) ? , } ) }
Parse a decompressed SWF and return a `Vec` of tags.
Parse a decompressed SWF and return a ` Vec ` of tags .
swf_buf
&SwfBuf
swf_buf
&SwfBuf
example
None
std::env::set_current_dir(env!("cargo_manifest_dir"));
let data = std::fs::read("tests/swfs/DefineSprite.swf").unwrap();
let stream = swf::decompress_swf(&data[..]).unwrap();
let swf = swf::parse_swf(&stream).unwrap();
println!("Number of frames: {}", swf.header.num_frames);
```
let data = std :: fs :: read ( " tests / swfs / DefineSprite . swf " ) . unwrap () ; let stream = swf :: decompress_swf ( &data [ .. ] ) . unwrap () ; let swf = swf :: parse_swf ( &stream ) . unwrap () ; println! ( " Number of frames : {} " swf . header . num_frames ) ; ` ` `