systemd-transient 0.1.2

Start transient systemd services using dbus, just like systemd-run.
Documentation
use std::time::Duration;

use thiserror::Error;
use zbus::zvariant::OwnedObjectPath;

#[derive(Error, Debug)]
pub enum SystemdTransientError {
  #[error("job stream ended")]
  JobStreamEnded,
  #[error("waiting for job of unit {unit} failed with reason {reason}")]
  JobWaitFailed { unit: String, reason: String },
  #[error("job {job} timed out after {}s", timeout.as_secs())]
  JobTimedOut {
    job: OwnedObjectPath,
    timeout: Duration,
  },
  #[error("unit {name} is already running")]
  UnitAlreadyRunning { name: String },
  #[error("unit {name} is not running")]
  UnitNotRunning { name: String },

  #[error("zbus error")]
  Zbus(#[from] zbus::Error),
}