pub struct CompletionNotifier { /* private fields */ }Expand description
A handle for notifying the session that Lua execution has completed.
Created by DebugSession::completion_notifier. Move this into the
thread that runs Lua code so it can emit DebugEvent::Terminated when
execution finishes (successfully or with an error).
§Idempotent
If the session was already terminated (e.g. via
DebugController::disconnect),
notify is a no-op — no duplicate event is sent.
Implementations§
Source§impl CompletionNotifier
impl CompletionNotifier
Sourcepub fn notify(self, error: Option<String>)
pub fn notify(self, error: Option<String>)
Signal that Lua execution has finished.
Transitions to SessionState::Terminated and emits
DebugEvent::Terminated. Pass Some(message) if execution
failed; None for normal completion.
Note: This method sets result to None. Use
notify_with_result to also report
a successful return value.
Sourcepub fn notify_with_result(self, result: Option<String>, error: Option<String>)
pub fn notify_with_result(self, result: Option<String>, error: Option<String>)
Signal that Lua execution has finished, with an optional result.
Like notify, but additionally propagates a
successful return value through DebugEvent::Terminated::result.
Auto Trait Implementations§
impl Freeze for CompletionNotifier
impl RefUnwindSafe for CompletionNotifier
impl Send for CompletionNotifier
impl Sync for CompletionNotifier
impl Unpin for CompletionNotifier
impl UnsafeUnpin for CompletionNotifier
impl UnwindSafe for CompletionNotifier
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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