Struct owasm_vm::vm::Environment
source · [−]pub struct Environment<Q>where
Q: Querier + 'static,{ /* private fields */ }Implementations
sourceimpl<Q> Environment<Q>where
Q: Querier + 'static,
impl<Q> Environment<Q>where
Q: Querier + 'static,
pub fn new(q: Q) -> Self
pub fn with_querier_from_context<C, R>(&self, callback: C) -> Rwhere
C: FnOnce(&Q) -> R,
sourcepub fn set_wasmer_instance(&self, instance: Option<NonNull<Instance>>)
pub fn set_wasmer_instance(&self, instance: Option<NonNull<Instance>>)
Creates a back reference from a contact to its partent instance
pub fn with_wasmer_instance<C, R>(&self, callback: C) -> Result<R, Error>where
C: FnOnce(&Instance) -> Result<R, Error>,
pub fn get_gas_left(&self) -> u64
pub fn set_gas_left(&self, new_value: u64)
pub fn decrease_gas_left(&self, gas: u64) -> Result<(), Error>
pub fn memory(&self) -> Result<Memory, Error>
Trait Implementations
sourceimpl<Q: Querier + 'static> Clone for Environment<Q>
impl<Q: Querier + 'static> Clone for Environment<Q>
sourceimpl<Q> WasmerEnv for Environment<Q>where
Q: Querier + 'static,
impl<Q> WasmerEnv for Environment<Q>where
Q: Querier + 'static,
sourcefn init_with_instance(
&mut self,
instance: &Instance
) -> Result<(), HostEnvInitError>
fn init_with_instance(
&mut self,
instance: &Instance
) -> Result<(), HostEnvInitError>
The function that Wasmer will call on your type to let it finish
setting up the environment with data from the
Instance. Read moreimpl<Q: Querier> Send for Environment<Q>
impl<Q: Querier> Sync for Environment<Q>
Auto Trait Implementations
impl<Q> RefUnwindSafe for Environment<Q>
impl<Q> Unpin for Environment<Q>
impl<Q> UnwindSafe for Environment<Q>
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref