[−][src]Struct wasmer_middleware_common::metering::Metering
Metering is a compiler middleware that calculates the cost of WebAssembly instructions at compile
time and will count the cost of executed instructions at runtime. Within the Metering functionality,
this instruction cost is called points
.
The Metering struct takes a limit
parameter which is the maximum number of points which can be
used by an instance during a function call. If this limit is exceeded, the function call will
trap. Each instance has a points_used
field which can be used to track points used during
a function call and should be set back to zero after a function call.
Each compiler backend with Metering enabled should produce the same cost used at runtime for the same function calls so we can say that the metering is deterministic.
Methods
impl Metering
[src]
Trait Implementations
impl FunctionMiddleware for Metering
[src]
type Error = String
fn feed_event<'a, 'b: 'a>(
&mut self,
op: Event<'a, 'b>,
_module_info: &ModuleInfo,
sink: &mut EventSink<'a, 'b>
) -> Result<(), Self::Error>
[src]
&mut self,
op: Event<'a, 'b>,
_module_info: &ModuleInfo,
sink: &mut EventSink<'a, 'b>
) -> Result<(), Self::Error>
Auto Trait Implementations
impl Sync for Metering
impl Send for Metering
impl Unpin for Metering
impl RefUnwindSafe for Metering
impl UnwindSafe for Metering
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,