pub trait TypeTrace {
// Required methods
fn trace<F, E>(&self, func: &mut F) -> Result<(), E>
where F: FnMut(EngineOrModuleTypeIndex) -> Result<(), E>;
fn trace_mut<F, E>(&mut self, func: &mut F) -> Result<(), E>
where F: FnMut(&mut EngineOrModuleTypeIndex) -> Result<(), E>;
// Provided methods
fn trace_engine_indices<F, E>(&self, func: &mut F) -> Result<(), E>
where F: FnMut(VMSharedTypeIndex) -> Result<(), E> { ... }
fn canonicalize_for_runtime_usage<F>(&mut self, module_to_engine: &mut F)
where F: FnMut(ModuleInternedTypeIndex) -> VMSharedTypeIndex { ... }
fn is_canonicalized_for_runtime_usage(&self) -> bool { ... }
fn canonicalize_for_hash_consing<F>(
&mut self,
rec_group_range: Range<ModuleInternedTypeIndex>,
module_to_engine: &mut F,
)
where F: FnMut(ModuleInternedTypeIndex) -> VMSharedTypeIndex { ... }
fn is_canonicalized_for_hash_consing(&self) -> bool { ... }
}
Expand description
A trait for things that can trace all type-to-type edges, aka all type indices within this thing.
Required Methods§
Provided Methods§
sourcefn trace_engine_indices<F, E>(&self, func: &mut F) -> Result<(), E>
fn trace_engine_indices<F, E>(&self, func: &mut F) -> Result<(), E>
Trace all VMSharedTypeIndex
edges, ignoring other edges.
sourcefn canonicalize_for_runtime_usage<F>(&mut self, module_to_engine: &mut F)
fn canonicalize_for_runtime_usage<F>(&mut self, module_to_engine: &mut F)
Canonicalize self
by rewriting all type references inside self
from
module-level interned type indices to engine-level interned type
indices.
This produces types that are suitable for usage by the runtime (only
contains VMSharedTypeIndex
type references).
This does not produce types that are suitable for hash consing types (must have recgroup-relative indices for type indices referencing other types in the same recgroup).
sourcefn is_canonicalized_for_runtime_usage(&self) -> bool
fn is_canonicalized_for_runtime_usage(&self) -> bool
Is this type canonicalized for runtime usage?
sourcefn canonicalize_for_hash_consing<F>(
&mut self,
rec_group_range: Range<ModuleInternedTypeIndex>,
module_to_engine: &mut F,
)
fn canonicalize_for_hash_consing<F>( &mut self, rec_group_range: Range<ModuleInternedTypeIndex>, module_to_engine: &mut F, )
Canonicalize self
by rewriting all type references inside self
from
module-level interned type indices to either engine-level interned type
indices or recgroup-relative indices.
This produces types that are suitable for hash consing and deduplicating recgroups (types may have recgroup-relative indices for references to other types within the same recgroup).
This does not produce types that are suitable for usage by the runtime
(only contain VMSharedTypeIndex
type references).
sourcefn is_canonicalized_for_hash_consing(&self) -> bool
fn is_canonicalized_for_hash_consing(&self) -> bool
Is this type canonicalized for hash consing?