Skip to main content

TimeTravelDebugger

Struct TimeTravelDebugger 

Source
pub struct TimeTravelDebugger {
    pub config: TimeTravelConfig,
    /* private fields */
}
Expand description

Time-travel debugger

Fields§

§config: TimeTravelConfig

Configuration

Implementations§

Source§

impl TimeTravelDebugger

Source

pub fn new() -> Self

Create new time travel debugger

Source

pub fn with_config(self, config: TimeTravelConfig) -> Self

Set configuration

Source

pub fn max_snapshots(self, max: usize) -> Self

Set max snapshots

Source

pub fn record(&mut self, snapshot: StateSnapshot)

Record a new snapshot

Source

pub fn record_action( &mut self, action: Action, state: HashMap<String, SnapshotValue>, )

Record state with action

Source

pub fn pause(&mut self)

Pause recording

Source

pub fn resume(&mut self)

Resume recording

Source

pub fn toggle_recording(&mut self)

Toggle recording

Source

pub fn is_paused(&self) -> bool

Is recording paused

Source

pub fn clear(&mut self)

Clear all snapshots

Source

pub fn current(&self) -> Option<&StateSnapshot>

Get current snapshot

Source

pub fn get(&self, index: usize) -> Option<&StateSnapshot>

Get snapshot at index

Source

pub fn snapshots(&self) -> &[StateSnapshot]

Get all snapshots

Source

pub fn position(&self) -> usize

Get current position

Source

pub fn count(&self) -> usize

Get total snapshot count

Source

pub fn step_back(&mut self)

Step backward one snapshot

Source

pub fn step_forward(&mut self)

Step forward one snapshot

Source

pub fn jump_to(&mut self, index: usize)

Jump to specific snapshot

Source

pub fn jump_to_latest(&mut self)

Jump to latest snapshot

Source

pub fn jump_to_first(&mut self)

Jump to first snapshot

Source

pub fn is_traveling(&self) -> bool

Is currently traveling in history

Source

pub fn current_diff(&self) -> Option<StateDiff>

Get diff between current and previous snapshot

Source

pub fn diff_between(&self, from: usize, to: usize) -> Option<StateDiff>

Get diff between two positions

Source

pub fn export(&self) -> String

Export session history as JSON string

Source

pub fn import(&mut self, snapshots: Vec<StateSnapshot>)

Import session from exported data

Source

pub fn set_view(&mut self, view: TimeTravelView)

Set view mode

Source

pub fn view(&self) -> TimeTravelView

Get current view

Source

pub fn next_view(&mut self)

Next view

Source

pub fn select_next(&mut self)

Select next item

Source

pub fn select_prev(&mut self)

Select previous item

Source

pub fn render_content( &self, buffer: &mut Buffer, area: Rect, config: &DevToolsConfig, )

Render time travel debugger content

Trait Implementations§

Source§

impl Default for TimeTravelDebugger

Source§

fn default() -> Self

Returns the “default value” for a type. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.