Skip to main content

CommandLifetimeLock

Struct CommandLifetimeLock 

Source
pub struct CommandLifetimeLock { /* private fields */ }
Expand description

Exclusive custody for one journal operation’s local command attempt.

Persist Self::record and dispatch intent before spawning. This primitive does not consume durable paid-call authority or qualify a backend’s retry policy.

Implementations§

Source§

impl CommandLifetimeLock

Source

pub fn acquire( journal: &Path, operation_sequence: u64, ) -> Result<Self, CommandLifetimeLockError>

Acquire an operation’s regular no-follow sidecar without waiting.

The journal parent must already exist. The journal leaf may be absent; aliases of an explicitly selected parent resolve to one location.

§Errors

Rejects unsafe journal/sidecar entries, contention, invalid identity and IO failures.

Source

pub fn record(&self) -> &CommandCustodyRecord

Return exact custody evidence for durable retention before dispatch.

Source

pub fn path(&self) -> &Path

Return the retained sidecar path; dropping custody never removes it.

Source

pub fn spawn( &mut self, command: Command, ) -> Result<Child, CommandLifetimeLockError>

Attempt one trusted command with owned descriptor inheritance.

Consumes this guard’s single spawn allowance before the spawn attempt. The command value is consumed and dropped, so its parent-side descriptor copy cannot outlive spawn. The owner descriptor remains close-on-exec. The selected backend must preserve inherited custody in its descendants. Caller code owns argv admission, output/deadline limits and child reaping.

§Errors

Rejects repeated dispatch, replaced sidecars, unsupported hosts and spawn failures.

Source

pub fn finish(self) -> Result<CommandQuiescenceGuard, CommandLifetimeLockError>

Close owner custody and admit exact quiescence within a bounded grace period.

Success returns an exclusive non-spawning guard. Contention means another inherited holder remains; command exit alone is insufficient. Failures retain the sidecar and do not establish that a remote effect failed.

§Errors

Returns in-flight custody, changed/missing/unsafe sidecars and IO failures.

Trait Implementations§

Source§

impl Debug for CommandLifetimeLock

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.