-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Command and RemoteChild owning their session
Supporting session-owning commands (and children) makes it easier to e.g. move long-running children around, or store them around in structures, without having to deal with self-reference issues. Currently, support is limited to clonable smart pointers which can be coerced to `&Session`. It was not entirely clear whether `Deref`, `Borrow`, or `AsRef` would be best, may need to be updated before release it it proves sub-par. Does not work with a bare `Session` because `Command::spawn`, `Command::output`, and `Command::status` take self by (mutable) reference, so there is no way to consume the `Session` out. Generally `Command` as a builder is set up around chaining mutable references rather than moving ownership. Had to shuffle names a bit to try and avoid breaking backwards compatibility, which is not great: the internal `Command` becomes the external `OwningCommand`, and the old `RemoteChild` is now `Child`, with the external `RemoteChild` being an alias.
- Loading branch information
Showing
6 changed files
with
237 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.