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§
Source§impl<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> Freeze for Store<FR>
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§
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.