[−][src]Struct sp_sandbox::EnvironmentDefinitionBuilder
Struct that can be used for defining an environment for a sandboxed module.
The sandboxed module can access only the entities which were defined and passed to the module at the instantiation time.
Implementations
impl<T> EnvironmentDefinitionBuilder<T>
[src]
pub fn new() -> EnvironmentDefinitionBuilder<T>
[src]
Construct a new EnvironmentDefinitionBuilder
.
pub fn add_host_func<N1, N2>(
&mut self,
module: N1,
field: N2,
f: HostFuncType<T>
) where
N1: Into<Vec<u8>>,
N2: Into<Vec<u8>>,
[src]
&mut self,
module: N1,
field: N2,
f: HostFuncType<T>
) where
N1: Into<Vec<u8>>,
N2: Into<Vec<u8>>,
Register a host function in this environment definition.
NOTE that there is no constraints on type of this function. An instance
can import function passed here with any signature it wants. It can even import
the same function (i.e. with same module
and field
) several times. It's up to
the user code to check or constrain the types of signatures.
pub fn add_memory<N1, N2>(&mut self, module: N1, field: N2, mem: Memory) where
N1: Into<Vec<u8>>,
N2: Into<Vec<u8>>,
[src]
N1: Into<Vec<u8>>,
N2: Into<Vec<u8>>,
Register a memory in this environment definition.
Auto Trait Implementations
impl<T> !RefUnwindSafe for EnvironmentDefinitionBuilder<T>
impl<T> !Send for EnvironmentDefinitionBuilder<T>
impl<T> !Sync for EnvironmentDefinitionBuilder<T>
impl<T> Unpin for EnvironmentDefinitionBuilder<T>
impl<T> !UnwindSafe for EnvironmentDefinitionBuilder<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
[src]
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
fn from_ref(outer: &Outer) -> &T
[src]
Get a reference to the inner from the outer.
fn from_mut(outer: &mut Outer) -> &mut T
[src]
Get a mutable reference to the inner from the outer.
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]
T: UncheckedFrom<S>,
fn unchecked_into(self) -> T
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,