Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ tokio-tungstenite = { version = "0.24", default-features = false, features = ["c

[target.'cfg(windows)'.dependencies]
zip = { version = "2", default-features = false, features = ["deflate"], optional = true }
# Windows Job Object primitives backing `process_tree`'s CLI process-tree
# containment (`JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE`).
windows-sys = { version = "0.61", default-features = false, features = [
"Win32_Foundation",
"Win32_System_JobObjects",
"Win32_System_Threading",
] }

[target.'cfg(unix)'.dependencies]
# Process-group primitives backing `process_tree`'s CLI process-tree
# containment (`killpg`).
libc = "0.2"

[dev-dependencies]
rusqlite = { version = "0.35", features = ["bundled"] }
Expand Down
15 changes: 8 additions & 7 deletions rust/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,20 +399,21 @@ fn capture_backtrace() -> Option<Box<Backtrace>> {
/// Aggregate of errors collected during [`crate::Client::stop`].
///
/// `Client::stop` performs cooperative shutdown across every active
/// session before killing the CLI child process. Errors from any
/// per-session `session.destroy` RPC and from the terminal child-kill
/// step are collected here rather than short-circuiting on the first
/// failure, so callers see the full picture of what went wrong during
/// teardown.
/// session before tearing down the CLI's process tree. Errors from any
/// per-session `session.destroy` RPC, runtime shutdown, process-tree
/// termination, and the terminal child reap are collected here rather
/// than short-circuiting on the first failure, so callers see the full
/// picture of what went wrong during teardown.
///
/// Implements [`std::error::Error`] and forwards to `Display` for the
/// first error, with a count suffix when there are more.
#[derive(Debug)]
pub struct StopErrors(pub(crate) Vec<Error>);

impl StopErrors {
/// Borrow the collected errors as a slice, in the order they
/// occurred (per-session destroys first, then child-kill last).
/// Borrow the collected errors as a slice, in the order they occurred
/// (per-session destroys first, then runtime shutdown, process-tree
/// termination, and the final child reap).
pub fn errors(&self) -> &[Error] {
&self.0
}
Expand Down
Loading
Loading