pub struct Arena {
pub name: String,
pub types: Vec<TypeDef>,
pub functions: Vec<Function>,
pub children: Vec<Arena>,
}Expand description
An arena containing type definitions, functions, and child arenas.
Arenas replace the Package/Interface split with a unified scoping structure. They can be nested to represent hierarchical namespaces.
Fields§
§name: StringName of this arena (e.g., “math”, “wasi:cli/stdout”)
types: Vec<TypeDef>Type definitions in this arena
functions: Vec<Function>Functions in this arena
children: Vec<Arena>Child arenas (for hierarchical namespaces)
Implementations§
Source§impl Arena
impl Arena
Sourcepub fn add_function(&mut self, func: Function)
pub fn add_function(&mut self, func: Function)
Add a function to this arena.
Sourcepub fn find_type(&self, name: &str) -> Option<&TypeDef>
pub fn find_type(&self, name: &str) -> Option<&TypeDef>
Find a type definition by name in this arena.
Sourcepub fn find_function(&self, name: &str) -> Option<&Function>
pub fn find_function(&self, name: &str) -> Option<&Function>
Find a function by name in this arena.
Sourcepub fn imports(&self) -> Vec<Function>
pub fn imports(&self) -> Vec<Function>
Get all imported functions from this package arena.
Returns functions from the “imports” child arena, flattened across interfaces.
Each function includes its interface name in the interface field.
Sourcepub fn exports(&self) -> Vec<Function>
pub fn exports(&self) -> Vec<Function>
Get all exported functions from this package arena.
Returns functions from the “exports” child arena, flattened across interfaces.
Each function includes its interface name in the interface field.
Sourcepub fn imported_function_names(&self, interface_name: &str) -> Vec<String>
pub fn imported_function_names(&self, interface_name: &str) -> Vec<String>
Get imported function names for a specific interface.
Useful for subset hash verification - given an interface name, returns the names of functions the actor imports from it.
Sourcepub fn exported_function_names(&self, interface_name: &str) -> Vec<String>
pub fn exported_function_names(&self, interface_name: &str) -> Vec<String>
Get exported function names for a specific interface.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Arena
impl<'de> Deserialize<'de> for Arena
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Arena
impl StructuralPartialEq for Arena
Auto Trait Implementations§
impl Freeze for Arena
impl RefUnwindSafe for Arena
impl Send for Arena
impl Sync for Arena
impl Unpin for Arena
impl UnsafeUnpin for Arena
impl UnwindSafe for Arena
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more