Struct ck3save::Ck3ExtractorBuilder
source · [−]pub struct Ck3ExtractorBuilder { /* private fields */ }
Expand description
Customize how a save is extracted
Implementations
sourceimpl Ck3ExtractorBuilder
impl Ck3ExtractorBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new extractor with default values: extract zips into memory and ignore unknown binary tokens
sourcepub fn with_extraction(self, extraction: Extraction) -> Self
pub fn with_extraction(self, extraction: Extraction) -> Self
Set the memory allocation extraction behavior for when a zip is encountered
sourcepub fn with_on_failed_resolve(self, strategy: FailedResolveStrategy) -> Self
pub fn with_on_failed_resolve(self, strategy: FailedResolveStrategy) -> Self
Set the behavior for when an unresolved binary token is encountered
sourcepub fn extract_header_owned(
&self,
data: &[u8]
) -> Result<(HeaderOwned, Encoding), Ck3Error>
pub fn extract_header_owned(
&self,
data: &[u8]
) -> Result<(HeaderOwned, Encoding), Ck3Error>
Extract the header from the save.
sourcepub fn extract_header_borrowed<'a>(
&self,
data: &'a [u8]
) -> Result<(HeaderBorrowed<'a>, Encoding), Ck3Error>
pub fn extract_header_borrowed<'a>(
&self,
data: &'a [u8]
) -> Result<(HeaderBorrowed<'a>, Encoding), Ck3Error>
Extract the header from the save with zero copy deserialization.
sourcepub fn extract_header_with_tokens_as<'de, T, Q>(
&self,
data: &'de [u8],
resolver: &'de Q
) -> Result<(T, Encoding), Ck3Error> where
T: Deserialize<'de>,
Q: TokenResolver,
pub fn extract_header_with_tokens_as<'de, T, Q>(
&self,
data: &'de [u8],
resolver: &'de Q
) -> Result<(T, Encoding), Ck3Error> where
T: Deserialize<'de>,
Q: TokenResolver,
Extract the header from the save as a custom type
sourcepub fn extract_header_as<'de, T>(
&self,
data: &'de [u8]
) -> Result<(T, Encoding), Ck3Error> where
T: Deserialize<'de>,
pub fn extract_header_as<'de, T>(
&self,
data: &'de [u8]
) -> Result<(T, Encoding), Ck3Error> where
T: Deserialize<'de>,
Extract the header from the save as a custom type
sourcepub fn extract_save<R>(
&self,
reader: R
) -> Result<(Gamestate, Encoding), Ck3Error> where
R: Read + Seek,
pub fn extract_save<R>(
&self,
reader: R
) -> Result<(Gamestate, Encoding), Ck3Error> where
R: Read + Seek,
Extract all info from a save
sourcepub fn extract_save_with_tokens_as<T, R, Q>(
&self,
reader: R,
resolver: &Q
) -> Result<(T, Encoding), Ck3Error> where
R: Read + Seek,
T: DeserializeOwned,
Q: TokenResolver,
pub fn extract_save_with_tokens_as<T, R, Q>(
&self,
reader: R,
resolver: &Q
) -> Result<(T, Encoding), Ck3Error> where
R: Read + Seek,
T: DeserializeOwned,
Q: TokenResolver,
Extract all info from a save as a custom type
sourcepub fn extract_save_as<T, R>(
&self,
reader: R
) -> Result<(T, Encoding), Ck3Error> where
R: Read + Seek,
T: DeserializeOwned,
pub fn extract_save_as<T, R>(
&self,
reader: R
) -> Result<(T, Encoding), Ck3Error> where
R: Read + Seek,
T: DeserializeOwned,
Extract all info from a save as a custom type
Trait Implementations
sourceimpl Clone for Ck3ExtractorBuilder
impl Clone for Ck3ExtractorBuilder
sourcefn clone(&self) -> Ck3ExtractorBuilder
fn clone(&self) -> Ck3ExtractorBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Ck3ExtractorBuilder
impl Debug for Ck3ExtractorBuilder
Auto Trait Implementations
impl RefUnwindSafe for Ck3ExtractorBuilder
impl Send for Ck3ExtractorBuilder
impl Sync for Ck3ExtractorBuilder
impl Unpin for Ck3ExtractorBuilder
impl UnwindSafe for Ck3ExtractorBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more