Struct gingerlib::Quest3DFile
source · pub struct Quest3DFile {
pub tags: Vec<Tag>,
}Expand description
Struct representing a channel group file, which is used by the Quest3D engine to store any kind of data. It contains several “tags”, which consist of a 4 character name and the data. The actual file will contain a 4-byte-long number indicating after the name, but this is not stored in the struct. Tags may also contain no data at all, which is the case for the A3DG tag, since it’s used as the magic number.
Fields§
Implementations§
source§impl Quest3DFile
impl Quest3DFile
sourcepub fn read(path: &str) -> Result<Self, Box<dyn Error>>
pub fn read(path: &str) -> Result<Self, Box<dyn Error>>
Reads a file from the specified path.
This works with compressed and protected files too, in those cases it will automatically decompress it and remove the protection.
Example
use gingerlib::Quest3DFile;
let file = Quest3DFile::read("./test.cgr").unwrap();
assert_eq!(file.tags.len(), 150);Returns
The loaded Quest3DFile.
Errors
Returns an std::io::Error if the file could not be opened.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Quest3DFile
impl Send for Quest3DFile
impl Sync for Quest3DFile
impl Unpin for Quest3DFile
impl UnwindSafe for Quest3DFile
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more