pub struct Environment<Q>where
Q: Querier + 'static,{ /* private fields */ }
Implementations§
Source§impl<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) -> 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>
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§
Source§impl<Q: Querier + 'static> Clone for Environment<Q>
impl<Q: Querier + 'static> Clone for Environment<Q>
Source§impl<Q> WasmerEnv for Environment<Q>where
Q: Querier + 'static,
impl<Q> WasmerEnv for Environment<Q>where
Q: Querier + 'static,
Source§fn 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> Freeze for Environment<Q>
impl<Q> RefUnwindSafe for Environment<Q>
impl<Q> Unpin for Environment<Q>
impl<Q> UnwindSafe for Environment<Q>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§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.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Upcastable for T
impl<T> Upcastable for T
Source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
Source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref