pub struct Debuggee<T: Send + 'static> { /* private fields */ }Expand description
A Debuggee wraps up state associated with debugging the code
running in a single Store.
It acts as a Future combinator, wrapping an inner async body that
performs some actions on a store. Those actions are subject to the
debugger, and debugger events will be raised as appropriate. From
the “outside” of this combinator, it is always in one of two
states: running or paused. When paused, it acts as a
StoreContextMut and can allow examining the paused execution’s
state. One runs until the next event suspends execution by
invoking Debuggee::run.
Implementations§
Source§impl<T: Send + 'static> Debuggee<T>
impl<T: Send + 'static> Debuggee<T>
Sourcepub fn new<F>(store: Store<T>, inner: F) -> Debuggee<T>
pub fn new<F>(store: Store<T>, inner: F) -> Debuggee<T>
Create a new Debugger that attaches to the given Store and runs the given inner body.
The debugger is always in one of two states: running or paused.
When paused, the holder of this object can invoke
Debuggee::run to enter the running state. The inner body
will run until paused by a debug event. While running, the
future returned by either of these methods owns the Debuggee
and hence no other methods can be invoked.
When paused, the holder of this object can access the Store
indirectly by providing a closure
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Is the inner body done running?
Sourcepub fn interrupt_pending(&self) -> &Arc<AtomicBool>
pub fn interrupt_pending(&self) -> &Arc<AtomicBool>
Get the interrupt-pending flag. Setting this to true causes
the next epoch yield to surface as an Interrupted event.
Sourcepub async fn run(&mut self) -> Result<DebugRunResult>
pub async fn run(&mut self) -> Result<DebugRunResult>
Run the inner body until the next debug event.
This method is cancel-safe, and no events will be lost.
Sourcepub async fn finish(&mut self) -> Result<()>
pub async fn finish(&mut self) -> Result<()>
Run the debugger body until completion, with no further events.
Sourcepub async fn with_store<F: FnOnce(StoreContextMut<'_, T>) -> R + Send + 'static, R: Send + 'static>(
&mut self,
f: F,
) -> Result<R>
pub async fn with_store<F: FnOnce(StoreContextMut<'_, T>) -> R + Send + 'static, R: Send + 'static>( &mut self, f: F, ) -> Result<R>
Perform some action on the contained Store while not running.
This may only be invoked before the inner body finishes and
when it is paused; that is, when the Debuggee is initially
created and after any call to run() returns a result other
than DebugRunResult::Finished. If an earlier run()
invocation was canceled, it must be re-invoked and return
successfully before a query is made.
This is cancel-safe; if canceled, the result of the query will be dropped.
Auto Trait Implementations§
impl<T> Freeze for Debuggee<T>
impl<T> !RefUnwindSafe for Debuggee<T>
impl<T> Send for Debuggee<T>
impl<T> Sync for Debuggee<T>where
T: Sync,
impl<T> Unpin for Debuggee<T>
impl<T> UnsafeUnpin for Debuggee<T>
impl<T> !UnwindSafe for Debuggee<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read more