pub fn read_tag(&mut self) -> Result<Tag<'a>> {
        let (tag_code, length) = self.read_tag_code_and_length()?;
        let tag = self.read_tag_with_code(tag_code, length);

        if let Err(e) = tag {
            return Err(Error::swf_parse_error_with_source(tag_code, e));
        }

        tag
    }
/// Reads the next SWF tag from the stream.
/// # Example
/// ```
/// # std::env::set_current_dir(env!("CARGO_MANIFEST_DIR"));
/// let data = std::fs::read("tests/swfs/DefineSprite.swf").unwrap();
/// let mut swf_buf = swf::decompress_swf(&data[..]).unwrap();
/// let mut reader = swf::read::Reader::new(&swf_buf.data[..], swf_buf.header.version);
/// while let Ok(tag) = reader.read_tag() {
///     println!("Tag: {:?}", tag);
/// }
/// ```
Reads the next SWF tag from the stream.
Reads the next SWF tag from the stream .
pub fn read_tag(&mut self) -> Result<Tag<'a>> {
        let (tag_code, length) = self.read_tag_code_and_length()?;
        let tag = self.read_tag_with_code(tag_code, length);
        if let Err(e) = tag {
            return Err(Error::swf_parse_error_with_source(tag_code, e));
        }
        tag
    }
pub fn read_tag ( & mut self ) -> Result < Tag < ' a > > { let ( tag_code , length ) = self . read_tag_code_and_length ( ) ? ; let tag = self . read_tag_with_code ( tag_code , length ) ; if let Err ( e ) = tag { return Err ( Error :: swf_parse_error_with_source ( tag_code , e ) ) ; } tag }
Reads the next SWF tag from the stream.
Reads the next SWF tag from the stream .
&mut self
&mut self
example
None
std::env::set_current_dir(env!("cargo_manifest_dir"));
let data = std::fs::read("tests/swfs/DefineSprite.swf").unwrap();
let mut swf_buf = swf::decompress_swf(&data[..]).unwrap();
let mut reader = swf::read::Reader::new(&swf_buf.data[..], swf_buf.header.version);
while let Ok(tag) = reader.read_tag() {
println!("Tag: {:?}", tag);
}
```
let data = std :: fs :: read ( " tests / swfs / DefineSprite . swf " ) . unwrap () ; let mut swf_buf = swf :: decompress_swf ( &data [ .. ] ) . unwrap () ; let mut reader = swf :: read :: Reader :: new ( &swf_buf . data [ .. ] swf_buf . header . version ) ; while let Ok ( tag ) = reader . read_tag () { println! ( " Tag : { : ? } " tag ) ; } ` ` `