pub struct File { /* private fields */ }
Expand description
Represents a valid Darkest Dungeon save file.
See the main library docs for usage examples.
§A note on binary file identity
Files produced by the game currently contain unidentified bits.
Right now, if you read a binary file and encode it to binary
again, you will encounter some different bits. Theoretically,
sizes could be different due to data alignment, though this
has not been observed in practice yet.
Phrased differently, the Binary => File
conversion is minimally lossy.
File
=> Binary and File
<=> JSON conversions are lossless.
It is recommended that tools operating on the JSON representation preserve the order of fields in the file.
Implementations§
Source§impl File
impl File
Sourcepub fn try_from_bin<R: Read>(reader: &mut R) -> Result<Self, FromBinError>
pub fn try_from_bin<R: Read>(reader: &mut R) -> Result<Self, FromBinError>
Source§impl File
impl File
Sourcepub fn try_from_json<R: Read>(reader: &mut R) -> Result<Self, FromJsonError>
pub fn try_from_json<R: Read>(reader: &mut R) -> Result<Self, FromJsonError>
Trait Implementations§
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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