Skip to main content

Session

Struct Session 

Source
pub struct Session { /* private fields */ }
Expand description

A debugging session over one trace.

Implementations§

Source§

impl Session

Source

pub fn new(state: DebuggerState) -> Self

Source

pub fn with_chain(self, chain: Option<Box<dyn ChainStorage>>) -> Self

Reads storage slots the trace never touched from chain.

Source

pub fn state(&self) -> &DebuggerState

Source

pub fn state_mut(&mut self) -> &mut DebuggerState

Source

pub fn storage_words(&self) -> Option<StorageWords<'_>>

The storage words known at the current step, read from the chain for slots the trace never touched when a chain is attached.

Source

pub fn loaded(&self) -> Output

What was loaded: the trace’s size and the contracts with sources.

Source

pub fn initial_stop(&self) -> Vec<Output>

Where the session is now, as the first stop.

Source

pub fn execute(&mut self, command: DebuggerCommand) -> Vec<Output>

Runs one command and answers it.

Source

pub fn stop(&self, reason: StopReason) -> Option<Stop>

The current step as a stop, or None without a trace.

Source

pub fn breakpoints(&self) -> Output

Source

pub fn backtrace(&mut self) -> Output

The call structure at the current step, innermost frame first.

Source

pub fn listing(&self, radius: u64) -> Output

radius lines of source on each side of the current step’s line.

Source

pub fn memory(&self, offset: Option<u64>, length: Option<u64>) -> Output

Memory at the current step in 32-byte words, the whole of it or one range.

Source

pub fn storage(&self) -> Output

Every slot whose value is known at the current step: what the transaction has read or written so far in this frame’s storage.

Source

pub fn transient_storage(&self) -> Output

Every transient storage slot whose value is known at the current step.

Source

pub fn return_data(&self) -> Output

The return data buffer at the current step.

Source

pub fn calldata(&self) -> Output

Source

pub fn stack(&self, limit: Option<usize>) -> Output

The stack at the current step, all of it or the top limit words.

Source

pub fn variables(&mut self, filter: Option<&str>) -> Output

The variables in scope at the current step, or the one named by filter, which may be a path into a local or a state variable.

Source

pub fn resources(&self, json: bool) -> Output

The contracts whose debug resources are loaded.

Source

pub fn help(topic: Option<&str>) -> Output

The command list, or one command’s details.

Trait Implementations§

Source§

impl Debug for Session

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.