Skip to main content

CuDebugSession

Struct CuDebugSession 

Source
pub struct CuDebugSession<App, P, CB, TF, S, L>
where P: CopperListTuple, S: SectionStorage, L: UnifiedLogWrite<S> + 'static,
{ /* private fields */ }

Implementations§

Source§

impl<App, P, CB, TF, S, L> CuDebugSession<App, P, CB, TF, S, L>
where App: CuSimApplication<S, L>, L: UnifiedLogWrite<S> + 'static, S: SectionStorage, P: CopperListTuple, CB: for<'a> Fn(&'a CopperList<P>, RobotClock) -> Box<dyn for<'z> FnMut(App::Step<'z>) -> SimOverride + 'a>, TF: Fn(&CopperList<P>) -> Option<CuTime> + Clone,

Source

pub fn from_log( log_base: &Path, app: App, robot_clock: RobotClock, clock_mock: RobotClockMock, build_callback: CB, time_of: TF, ) -> CuResult<Self>

Build a session directly from a unified log on disk (streaming index, no bulk load).

Source

pub fn from_log_with_cache_cap( log_base: &Path, app: App, robot_clock: RobotClock, clock_mock: RobotClockMock, build_callback: CB, time_of: TF, cache_cap: usize, ) -> CuResult<Self>

Build a session directly from a log, with an explicit cache size.

Source

pub fn goto_cl(&mut self, culistid: u64) -> CuResult<JumpOutcome>

Jump to a copperlist by id.

Source

pub fn goto_time(&mut self, ts: CuTime) -> CuResult<JumpOutcome>

Jump to the first copperlist at or after a timestamp.

Source

pub fn step(&mut self, delta: i32) -> CuResult<JumpOutcome>

Step relative to the current cursor. Negative values rewind via keyframe.

Source

pub fn current_cl(&mut self) -> CuResult<Option<Arc<CopperList<P>>>>

Access the copperlist at the current cursor, if any (cloned).

Source

pub fn cl_at(&mut self, idx: usize) -> CuResult<Option<Arc<CopperList<P>>>>

Access a copperlist by absolute index in the log (cloned).

Source

pub fn total_entries(&self) -> usize

Total number of copperlists indexed in this session.

Source

pub fn nearest_keyframe_culistid(&self, target_culistid: u64) -> Option<u64>

The nearest keyframe (<= target CL), if any.

Source

pub fn section_cache_stats(&self) -> SectionCacheStats

Returns section-cache statistics for this session.

Source

pub fn current_index(&self) -> Option<usize>

Current absolute cursor index, if initialized.

Source

pub fn with_app<R>(&mut self, f: impl FnOnce(&mut App) -> R) -> R

Borrow the underlying application for inspection (e.g., task state asserts).

Source§

impl<App, P, CB, TF, S, L> CuDebugSession<App, P, CB, TF, S, L>
where App: CuSimApplication<S, L> + ReflectTaskIntrospection, L: UnifiedLogWrite<S> + 'static, S: SectionStorage, P: CopperListTuple, CB: for<'a> Fn(&'a CopperList<P>, RobotClock) -> Box<dyn for<'z> FnMut(App::Step<'z>) -> SimOverride + 'a>, TF: Fn(&CopperList<P>) -> Option<CuTime> + Clone,

Source

pub fn reflected_task(&self, task_id: &str) -> CuResult<&dyn Reflect>

Returns a reflected view of the current task instance by task id.

Source

pub fn reflected_task_mut( &mut self, task_id: &str, ) -> CuResult<&mut dyn Reflect>

Mutable reflected task view by task id.

Source

pub fn dump_reflected_task(&self, task_id: &str) -> CuResult<String>

Dumps the reflected runtime state of one task.

Source

pub fn dump_reflected_task_schemas(&self) -> String

Dumps reflected schemas registered by this application.

Auto Trait Implementations§

§

impl<App, P, CB, TF, S, L> Freeze for CuDebugSession<App, P, CB, TF, S, L>
where App: Freeze, CB: Freeze, TF: Freeze,

§

impl<App, P, CB, TF, S, L> RefUnwindSafe for CuDebugSession<App, P, CB, TF, S, L>

§

impl<App, P, CB, TF, S, L> Send for CuDebugSession<App, P, CB, TF, S, L>
where App: Send, CB: Send, TF: Send, P: Sync + Send,

§

impl<App, P, CB, TF, S, L> Sync for CuDebugSession<App, P, CB, TF, S, L>
where App: Sync, CB: Sync, TF: Sync, P: Sync + Send,

§

impl<App, P, CB, TF, S, L> Unpin for CuDebugSession<App, P, CB, TF, S, L>
where App: Unpin, CB: Unpin, TF: Unpin, S: Unpin, L: Unpin,

§

impl<App, P, CB, TF, S, L> UnsafeUnpin for CuDebugSession<App, P, CB, TF, S, L>
where App: UnsafeUnpin, CB: UnsafeUnpin, TF: UnsafeUnpin,

§

impl<App, P, CB, TF, S, L> UnwindSafe for CuDebugSession<App, P, CB, TF, S, L>

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
§

impl<A> Is for A
where A: Any,

§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.