#[non_exhaustive]pub struct EnvOptions {
pub context: Arc<FileContext>,
pub load: LoadMode,
pub dep_cache_bytes: u64,
pub resolver: Option<Arc<dyn CabResolver>>,
pub keep_resolver_loads: bool,
}Expand description
Environment options.
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.context: Arc<FileContext>Shared by every file loaded.
load: LoadModeWhen container entries are parsed.
dep_cache_bytes: u64The dependency LRU’s bound, in bytes of file data. u64::MAX with
Self::keep_resolver_loads (as Self::unitypy sets them) evicts
nothing, not even for a pool refusal, which then fails the read; any
other setting may evict (a pool refusal evicts the others and retries
once), and Environment::container_path then refuses a
dependency’s object.
resolver: Option<Arc<dyn CabResolver>>The find_file fallback; None finds nothing.
keep_resolver_loads: boolWhether the files the resolver loads (for find_file and a resource
read’s fallback) are kept in Environment::files as UnityPy keeps
them, and never evicted (module docs). False keeps them in the
dependency LRU only, whatever find_file’s is_dependency, a
PARITY.md divergence (section 19.3, “resolver loads under
keep_resolver_loads false”; section 19.2,
SerializedFile.load_dependencies).
Implementations§
Source§impl EnvOptions
impl EnvOptions
Sourcepub fn unitypy() -> Self
pub fn unitypy() -> Self
UnityPy’s behaviour: eager, nothing evicted, no resolver, resolver
loads kept in files as UnityPy keeps them.
Sourcepub fn batch(context: Arc<FileContext>) -> Self
pub fn batch(context: Arc<FileContext>) -> Self
The batch engine’s: lazy, a 512 MiB dependency cache, resolver loads
in that cache only (evictable, not in files).