pub struct ImportTable { /* private fields */ }
Expand description
Import table manages imported capabilities and promises
Implementations§
Source§impl ImportTable
impl ImportTable
Sourcepub fn new(allocator: Arc<IdAllocator>) -> Self
pub fn new(allocator: Arc<IdAllocator>) -> Self
Create a new import table with the given allocator
Sourcepub fn with_default_allocator() -> Self
pub fn with_default_allocator() -> Self
Create a new import table with a default allocator
Sourcepub fn allocate_local(&self) -> ImportId
pub fn allocate_local(&self) -> ImportId
Allocate a new local import ID
Sourcepub fn insert(&self, id: ImportId, value: ImportValue) -> Result<(), TableError>
pub fn insert(&self, id: ImportId, value: ImportValue) -> Result<(), TableError>
Insert a new import entry
Sourcepub fn get(&self, id: ImportId) -> Option<ImportValue>
pub fn get(&self, id: ImportId) -> Option<ImportValue>
Get an import entry
Sourcepub fn add_ref(&self, id: ImportId) -> Result<(), TableError>
pub fn add_ref(&self, id: ImportId) -> Result<(), TableError>
Increment the refcount for an import
Sourcepub fn release(&self, id: ImportId, refcount: u32) -> Result<bool, TableError>
pub fn release(&self, id: ImportId, refcount: u32) -> Result<bool, TableError>
Release an import with the given refcount
Sourcepub fn resolve_promise(
&self,
id: ImportId,
value: Value,
) -> Result<(), TableError>
pub fn resolve_promise( &self, id: ImportId, value: Value, ) -> Result<(), TableError>
Update a promise import to resolved state
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImportTable
impl !RefUnwindSafe for ImportTable
impl Send for ImportTable
impl Sync for ImportTable
impl Unpin for ImportTable
impl !UnwindSafe for ImportTable
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