pub struct ReusableTransientUnit { /* private fields */ }Implementations§
Source§impl ReusableTransientUnit
impl ReusableTransientUnit
Sourcepub async fn start(&mut self) -> Result<(), SystemdTransientError>
pub async fn start(&mut self) -> Result<(), SystemdTransientError>
The daemon decides whether the unit is running, not the cached handle, so a unit that exited on its own can be started again.
Sourcepub async fn adopt(&mut self) -> Result<bool, SystemdTransientError>
pub async fn adopt(&mut self) -> Result<bool, SystemdTransientError>
Takes over an already loaded unit of this name instead of starting
one, see SystemdTransientManager::adopt. Returns whether there was
one; afterwards status, wait_for_exit and stop work on it as after
start. A run this value already holds is kept, and true is returned.
pub async fn stop(&mut self) -> Result<UnitExit, SystemdTransientError>
pub async fn wait_for_exit(&self) -> Result<UnitExit, SystemdTransientError>
Sourcepub fn status(&self) -> UnitStatus
pub fn status(&self) -> UnitStatus
Read from the exit watch, without a D-Bus round trip.
Sourcepub async fn release(&mut self) -> Result<(), SystemdTransientError>
pub async fn release(&mut self) -> Result<(), SystemdTransientError>
Drops the reference on the last run without stopping it.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ReusableTransientUnit
impl !UnwindSafe for ReusableTransientUnit
impl Freeze for ReusableTransientUnit
impl Send for ReusableTransientUnit
impl Sync for ReusableTransientUnit
impl Unpin for ReusableTransientUnit
impl UnsafeUnpin for ReusableTransientUnit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more