Struct infinite_rs::TagFile
source · pub struct TagFile {
pub header: TagHeader,
pub dependencies: Vec<TagDependency>,
pub datablock: Vec<TagDataBlock>,
pub structs: Vec<TagStruct>,
pub data_references: Vec<TagDataReference>,
pub tag_references: Vec<TagReference>,
pub zoneset_header: TagZonesetHeader,
pub zonesets: Vec<TagZoneset>,
pub structure: Option<Box<dyn Any>>,
}Expand description
Tag structure containing structure of entire tag file.
Fields§
§header: TagHeaderHeader containing info on how to read other parts of the file.
dependencies: Vec<TagDependency>Tags that are referenced by this tag and that need to be lazy loaded.
datablock: Vec<TagDataBlock>Blocks making up the entire tag (Internal and External)
structs: Vec<TagStruct>Internal structure units of the tag.
data_references: Vec<TagDataReference>References to external data from the tag.
tag_references: Vec<TagReference>Tags that are referenced by this tag inside the module.
zoneset_header: TagZonesetHeaderZoneset header for reading the other zonesets.
zonesets: Vec<TagZoneset>Zonesets, unknown what these are.
structure: Option<Box<dyn Any>>Actual structure depending on their tag group. Access this using get_struct.
Implementations§
source§impl TagFile
impl TagFile
sourcepub fn read<R: BufRead + BufReaderExt + Seek>(
&mut self,
reader: &mut R,
) -> Result<()>
pub fn read<R: BufRead + BufReaderExt + Seek>( &mut self, reader: &mut R, ) -> Result<()>
Reads the tag fike from the given readers implementing BufRead, BufReaderExt and Seek.
§Arguments
reader- A mutable reference to a reader that implementsBufRead + BufReaderExt + Seekfrom which to read the data.
§Returns
Returns Ok(()) if the header is successfully read, or an (anyhow) Error if an I/O error occurs
or if the header data is invalid.
sourcepub fn read_struct<R: BufRead + BufReaderExt + Seek>(
&mut self,
tag_group: &str,
reader: &mut R,
) -> Result<()>
pub fn read_struct<R: BufRead + BufReaderExt + Seek>( &mut self, tag_group: &str, reader: &mut R, ) -> Result<()>
Reads the “structure” according to a tag’s group.
This function creates a Box<> smart pointer depending on the type of the tag. The structure can later be obtained using get_struct.
§Arguments
reader- A mutable reference to a reader that implementsBufRead, BufReaderExt and Seekfrom which to read the data.
§Returns
Returns Ok(()) if the header is successfully read, or an Err if an I/O error occurs
or if the header data is invalid.