pub struct GeneratorProvider<G> { /* private fields */ }Expand description
UnityPy’s get_nodes_up lookup/cache wrapper, usable in a provider chain.
Its entry bound only limits retention; it never changes an answer.
Implementations§
Source§impl<G: ScriptGenerator> GeneratorProvider<G>
impl<G: ScriptGenerator> GeneratorProvider<G>
Sourcepub fn new(
generator: G,
meter: &Arc<Meter>,
max_entries: usize,
refusal_detail: Arc<str>,
) -> Self
pub fn new( generator: G, meter: &Arc<Meter>, max_entries: usize, refusal_detail: Arc<str>, ) -> Self
Create an empty, fallibly grown cache on meter.
Sourcepub fn get_nodes_up(
&self,
assembly: &RawStr,
fullname: &RawStr,
) -> Result<Option<Arc<Tree>>, ProviderError>
pub fn get_nodes_up( &self, assembly: &RawStr, fullname: &RawStr, ) -> Result<Option<Arc<Tree>>, ProviderError>
Case-sensitive suffix normalization and cache keys as UnityPy supplies
them (helpers/TypeTreeGenerator.py:50-75). The original assembly name
is the key: Assembly and Assembly.dll remain distinct entries.
Trait Implementations§
Source§impl<G: Debug> Debug for GeneratorProvider<G>
impl<G: Debug> Debug for GeneratorProvider<G>
Source§impl<G: ScriptGenerator> TypeTreeProvider for GeneratorProvider<G>
impl<G: ScriptGenerator> TypeTreeProvider for GeneratorProvider<G>
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
A short name; the dump’s
l2.source is "tpk" for the TPK provider.Source§fn accepts_scripts(&self) -> bool
fn accepts_scripts(&self) -> bool
Whether this provider answers script requests (
TreeRequest::script):
UnityPy’s env.typetree_generator. Only then does the Environment
dereference a MonoBehaviour’s m_Script (P3; the TPK provider does not).Source§fn tree(
&self,
req: &TreeRequest<'_>,
) -> Result<Option<Arc<Tree>>, ProviderError>
fn tree( &self, req: &TreeRequest<'_>, ) -> Result<Option<Arc<Tree>>, ProviderError>
The tree for
req, or Ok(None) wherever UnityPy builds no node
list, which the caller turns into no_typetree. For a TPK that is
four cases: a class the TPK does not hold (KeyError); a version
below the class’s first entry, and a picked entry that is None (the
class removed at that version), both ValueError
(helpers/Tpk.py:472-481); and a picked entry with no release root
(AssertionError, Tpk.py:64), which Self::why_none tells
apart. The pick is UnityPy’s floor over
every entry in its stored order, None and release-less entries
included: a provider never steps back past one of them to an earlier
entry that has a tree.
Every request that maps to one tree of the provider’s data gets the
same Arc (UnityPy’s NODES_CACHE, Tpk.py:58-88, which shares one
tree among the TPK class entries of one class record; the TPK
provider shares one among the entries of one release root), so the
trees a chain caches are bounded by the provider’s data, not by the
versions an input names.Source§fn why_none(
&self,
class_id: i32,
version: Option<&UnityVersion>,
) -> Option<NoTree>
fn why_none( &self, class_id: i32, version: Option<&UnityVersion>, ) -> Option<NoTree>
Why the class tree of
class_id at version is none (NoTree),
where Self::tree answers Ok(None); version is None for a
file below format 7, which Self::tree is never asked about. None
where the provider has the tree, or does not say (the default).Source§fn common_strings(&self) -> Option<&CommonStrings>
fn common_strings(&self) -> Option<&CommonStrings>
The common strings blob typetrees index (UnityPy’s
get_common_strings(), its TPK’s table), when this provider has them:
a TPK provider does.Auto Trait Implementations§
impl<G> !Freeze for GeneratorProvider<G>
impl<G> !RefUnwindSafe for GeneratorProvider<G>
impl<G> !UnwindSafe for GeneratorProvider<G>
impl<G> Forget for GeneratorProvider<G>
impl<G> Move for GeneratorProvider<G>
impl<G> Send for GeneratorProvider<G>where
G: Send,
impl<G> Sync for GeneratorProvider<G>where
G: Sync,
impl<G> Unpin for GeneratorProvider<G>where
G: Unpin,
impl<G> UnsafeUnpin for GeneratorProvider<G>where
G: UnsafeUnpin,
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