Tweak the Subprocess api a bit.

From feedback from Andres changed SubProcess to just Job for
possible further changes to have the manager do things itself
without launching subprocesses.
Changed names objectpath to jobpath, exit_code to result, etc.
Removed Kill and added a force parameter to Cancel instead.
Also ran cargo fmt which tweaked indentation in a couple places.
Alos removed ExitCode, users can just call Wait again if needed.
This commit is contained in:
Jeremy Whiting 2024-05-20 11:05:46 -06:00 committed by Vicki Pfau
parent 6e51d1556b
commit f6298efbc9
4 changed files with 46 additions and 85 deletions

View file

@ -123,12 +123,12 @@ trait Manager {
#[proxy(
default_service = "com.steampowered.SteamOSManager1",
interface = "com.steampowered.SteamOSManager1.SubProcess",
interface = "com.steampowered.SteamOSManager1.Job",
assume_defaults = true
)]
trait SubProcess {
trait Job {
/// Cancel method
fn cancel(&self) -> zbus::Result<()>;
fn cancel(&self, force: bool) -> zbus::Result<()>;
/// ExitCode method
fn exit_code(&self) -> zbus::Result<i32>;
@ -136,9 +136,6 @@ trait SubProcess {
/// WaitForExitCode method
fn wait_for_exit_code(&self) -> zbus::Result<i32>;
/// Kill method
fn kill(&self) -> zbus::Result<()>;
/// Pause method
fn pause(&self) -> zbus::Result<()>;