docs(sdk): Wire::shutdown doc said the second call returns Ok; it returns Stopped
All checks were successful
ci / test (pull_request) Successful in 4m22s

The handle-level call takes the node out on the first shutdown, so a second
call reports the typed `WireError::Stopped` (covered by
`calls_after_shutdown_are_typed_errors_not_panics`). Only the node-level
`Node::shutdown()` is Ok-idempotent. The rustdoc claimed otherwise.
This commit is contained in:
agent 2026-09-12 15:26:17 -04:00
commit 48c06df2cf
No known key found for this signature in database

View file

@ -225,10 +225,15 @@ impl Wire {
/// attempt, stop the onion service, abort the retry worker, checkpoint the
/// sqlite WAL, and drop the Tor client.
///
/// Idempotent and safe to call twice, including from two threads: the
/// second call is a no-op returning `Ok`. After it, every other method on
/// this handle — including `send` — returns `WireError.Stopped` instead of
/// touching a dead client or panicking.
/// The *node* teardown is idempotent: a second `Node::shutdown()` returns
/// `Ok` without repeating the work. This handle is spent by the first call,
/// so a second `Wire::shutdown()` — or two concurrent teardowns — returns
/// the typed `WireError.Stopped` instead of a silent `Ok`: a double
/// teardown is a caller bug worth surfacing, and `Stopped` is already the
/// answer every other method gives. It never panics.
///
/// After it, every other method on this handle — including `send` —
/// returns `WireError.Stopped` instead of touching a dead client.
///
/// Never called at all when the process is killed outright (Doze, the
/// background-process killer, a force-stop): that is the case [`flush`]