#[non_exhaustive]pub struct FileContext {
pub runtime_config: Option<Arc<RuntimeConfig>>,
pub version: VersionPolicy,
pub floats: FloatMode,
pub write: WriteRules,
pub providers: Arc<ProviderChain>,
pub codecs: Arc<Codecs>,
pub decryptor: Option<Arc<dyn BlockDecryptor>>,
pub budget: Arc<dyn MemoryBudget>,
pub limits: Limits,
pub eager_asset_bundle: bool,
pub serialized_file_parse_typetree: bool,
/* private fields */
}Expand description
Options shared by every file of one load.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.runtime_config: Option<Arc<RuntimeConfig>>Optional mutable binding settings, snapshotted while each file loads.
version: VersionPolicyUnityPy’s config.FALLBACK_UNITY_VERSION, plus opt-in, reported overrides.
floats: FloatModeHow a float32 signalling NaN reaches the value (plan section 3.10).
write: WriteRulesThe writer’s alignment rules (plan section 3.11).
providers: Arc<ProviderChain>Typetree sources for stripped files, keyed by (class, version).
codecs: Arc<Codecs>Block codecs by compression type.
decryptor: Option<Arc<dyn BlockDecryptor>>Custom block decryption, overriding the built-in UnityCN decryptor.
budget: Arc<dyn MemoryBudget>Where decoded buffers are paid for.
limits: LimitsHard bounds.
eager_asset_bundle: boolRead the first AssetBundle object while a SerializedFile loads, and
fail the file when it fails, as UnityPy does (SerializedFile.py:316-324).
serialized_file_parse_typetree: boolUnityPy config: parse trees at load, but omit them on save from v13. Below v13 save retains the mandatory trees (Tier C writing).
Implementations§
Source§impl FileContext
impl FileContext
Sourcepub fn unitypy() -> Self
pub fn unitypy() -> Self
UnityPy 1.25.2’s behaviour: no fallback version, no providers, the
UnityPy codecs, no decryptor, no budget, FloatMode::UnityPy,
WriteRules::UnityPy, the AssetBundle read at load.
Sourcepub fn set_assetbundle_decrypt_key(
&mut self,
key: impl AsRef<[u8]>,
) -> Result<(), Error>
pub fn set_assetbundle_decrypt_key( &mut self, key: impl AsRef<[u8]>, ) -> Result<(), Error>
Sets this load’s UnityCN key (16 bytes, including for UTF-8 strings). An invalid length leaves the previous key intact. No global state.
Sourcepub fn read_options(&self) -> ReadOptions
pub fn read_options(&self) -> ReadOptions
The walker’s options for this context.
Sourcepub fn version_policy(&self) -> VersionPolicy
pub fn version_policy(&self) -> VersionPolicy
Version policy with the binding’s current fallback snapshot.