pub struct SaveFile {
contents: Vec<u8>,
binary: bool,
}
Expand description
A struct that represents a ck3 save file. It is just a wrapper around the contents of the save file. This is so that we can abstract away the compression, encoding and just return an abstract Tape that can be used to read from the save file.
Fields§
§contents: Vec<u8>
The contents of the save file, shared between all sections
binary: bool
Implementations§
Source§impl<'a> SaveFile
impl<'a> SaveFile
Sourcepub fn open<P: AsRef<Path>>(filename: P) -> Result<SaveFile, SaveFileError>
pub fn open<P: AsRef<Path>>(filename: P) -> Result<SaveFile, SaveFileError>
Open a save file. Internally uses File::open to open the file and then SaveFile::read to read the contents.
Auto Trait Implementations§
impl Freeze for SaveFile
impl RefUnwindSafe for SaveFile
impl Send for SaveFile
impl Sync for SaveFile
impl Unpin for SaveFile
impl UnwindSafe for SaveFile
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more