# Trait ethcore::trace::VMTracer [−] [src]

    pub trait VMTracer: Send {
        fn prepare_subtrace(&self, code: &[u8]) -> Self where Self: Sized;
        fn done_subtrace(&mut self, sub: Self) where Self: Sized;
        fn drain(self) -> Option<VMTrace>;

        fn trace_prepare_execute(&mut self,
                             _pc: usize,
                             _instruction: u8,
                             _gas_cost: &U256)
                             -> bool { ... }
        fn trace_executed(&mut self,
                      _gas_used: U256,
                      _stack_push: &[U256],
                      _mem_diff: Option<(usize, &[u8])>,
                      _store_diff: Option<(U256, U256)>) { ... }
    }

Used by executive to build VM traces.

## Required Methods

### `fn prepare_subtrace(&self, code: &[u8]) -> Self where Self: Sized`

Spawn subtracer which will be used to trace deeper levels of execution.

### `fn done_subtrace(&mut self, sub: Self) where Self: Sized`

Spawn subtracer which will be used to trace deeper levels of execution.

### `fn drain(self) -> Option<VMTrace>`

Consumes self and returns the VM trace.

## Provided Methods

### `fn trace_prepare_execute(&mut self,
_pc: usize,
_instruction: u8,
_gas_cost: &U256)
-> bool`

Trace the preparation to execute a single instruction. @returns true if `trace_executed` should be called.

### `fn trace_executed(&mut self,
_gas_used: U256,
_stack_push: &[U256],
_mem_diff: Option<(usize, &[u8])>,
_store_diff: Option<(U256, U256)>)`

Trace the finalised execution of a single instruction.

## Implementors

- `impl VMTracer for ExecutiveVMTracer`
- `impl VMTracer for NoopVMTracer`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)