[][src]Struct sp_sandbox::EnvironmentDefinitionBuilder

pub struct EnvironmentDefinitionBuilder<T> { /* fields omitted */ }

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]

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]

Register a memory in this environment definition.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,