pub struct MixPackage {
pub game: CncGame,
pub files: HashMap<String, Vec<u8>>,
}Expand description
MIX package
Fields§
§game: CncGameThe game version of the MIX package
files: HashMap<String, Vec<u8>>A map of file names to file data
Implementations§
Source§impl MixPackage
impl MixPackage
Source§impl MixPackage
impl MixPackage
Source§impl MixPackage
impl MixPackage
Sourcepub fn add_file(&mut self, data: &Path) -> Result<usize, Ra2Error>
pub fn add_file(&mut self, data: &Path) -> Result<usize, Ra2Error>
Add a file from filesystem to the package
§Arguments
data- Path to the file to add
§Returns
Size of the added file in bytes on success, or error if file not found
§Examples
use ra2_mix::MixPackage;
use std::path::Path;
let mut package = MixPackage::default();
package.add_file(Path::new("test.txt")).unwrap();Trait Implementations§
Source§impl Debug for MixPackage
impl Debug for MixPackage
Source§impl Default for MixPackage
impl Default for MixPackage
Source§fn default() -> MixPackage
fn default() -> MixPackage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MixPackage
impl RefUnwindSafe for MixPackage
impl Send for MixPackage
impl Sync for MixPackage
impl Unpin for MixPackage
impl UnwindSafe for MixPackage
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