[−][src]Struct ddsavelib::File
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
impl File
[src]
pub fn try_from_bin<R: Read>(reader: &mut R) -> Result<Self, FromBinError>
[src]
pub fn write_to_bin<W: Write>(&self, writer: &mut W) -> Result<()>
[src]
Write this File
as Binary.
impl File
[src]
pub fn try_from_json<R: Read>(reader: &mut R) -> Result<Self, FromJsonError>
[src]
pub fn write_to_json<T: AsRef<str>, W: Write>(
&self,
writer: &mut W,
allow_dupes: bool,
unhash: &Unhasher<T>
) -> Result<()>
[src]
&self,
writer: &mut W,
allow_dupes: bool,
unhash: &Unhasher<T>
) -> Result<()>
Write this File
as JSON.
Trait Implementations
impl Clone for File
[src]
impl Debug for File
[src]
impl PartialEq<File> for File
[src]
impl StructuralPartialEq for File
[src]
Auto Trait Implementations
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,