Trait wasmtime::ResourceLimiterAsync
source · [−]pub trait ResourceLimiterAsync {
fn memory_growing<'life0, 'async_trait>(
&'life0 mut self,
current: usize,
desired: usize,
maximum: Option<usize>
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn table_growing<'life0, 'async_trait>(
&'life0 mut self,
current: u32,
desired: u32,
maximum: Option<u32>
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn memory_grow_failed(&mut self, _error: &Error) { ... }
fn table_grow_failed(&mut self, _error: &Error) { ... }
fn instances(&self) -> usize { ... }
fn tables(&self) -> usize { ... }
fn memories(&self) -> usize { ... }
}
Expand description
Used by hosts to limit resource consumption of instances. Identical to
ResourceLimiter
, except that the memory_growing
and table_growing
functions are async. Must be used with an async Store
.
This trait is used with
Store::limiter_async
`: see those docs
for restrictions on using other Wasmtime interfaces with an async resource
limiter.
Required methods
Async version of ResourceLimiter::memory_growing
Provided methods
fn memory_grow_failed(&mut self, _error: &Error)
fn memory_grow_failed(&mut self, _error: &Error)
Identical to ResourceLimiter::memory_grow_failed
fn table_grow_failed(&mut self, _error: &Error)
fn table_grow_failed(&mut self, _error: &Error)
Identical to ResourceLimiter::table_grow_failed
Identical to ResourceLimiter::instances
`
Identical to ResourceLimiter::tables
`
Identical to ResourceLimiter::memories
`