Struct sc_executor_common::sandbox::Store
source · [−]pub struct Store<FR> { /* private fields */ }
Expand description
This struct keeps track of all sandboxed components.
This is generic over a supervisor function reference type.
Implementations
sourceimpl<FR> Store<FR>
impl<FR> Store<FR>
sourcepub fn new_memory(&mut self, initial: u32, maximum: u32) -> Result<u32>
pub fn new_memory(&mut self, initial: u32, maximum: u32) -> Result<u32>
Create a new memory instance and return it’s index.
Errors
Returns Err
if the memory couldn’t be created.
Typically happens if initial
is more than maximum
.
sourcepub fn instance(&self, instance_idx: u32) -> Result<Rc<SandboxInstance<FR>>>
pub fn instance(&self, instance_idx: u32) -> Result<Rc<SandboxInstance<FR>>>
Returns SandboxInstance
by instance_idx
.
Errors
Returns Err
If instance_idx
isn’t a valid index of an instance or
instance is already torndown.
sourcepub fn memory(&self, memory_idx: u32) -> Result<MemoryRef>
pub fn memory(&self, memory_idx: u32) -> Result<MemoryRef>
Returns reference to a memory instance by memory_idx
.
Errors
Returns Err
If memory_idx
isn’t a valid index of an memory or
if memory has been torn down.
Auto Trait Implementations
impl<FR> !RefUnwindSafe for Store<FR>
impl<FR> !Send for Store<FR>
impl<FR> !Sync for Store<FR>
impl<FR> Unpin for Store<FR>
impl<FR> !UnwindSafe for Store<FR>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
sourceimpl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
sourcepub fn unchecked_into(self) -> T
pub fn unchecked_into(self) -> T
The counterpart to unchecked_from
.