pub trait Host {
type Gen: GenerationBackend;
type Inv: InventoryBackend;
// Required methods
fn generations(&self) -> &Self::Gen;
fn inventory(&self) -> &Self::Inv;
fn execute_runtime(&self, t: &Transition, op: &OpId) -> Outcome;
fn reobserve(&self, txn: &Transaction) -> Outcome;
fn check(&self, txn: &Transaction, phase: CheckPhase) -> Verdict;
fn release_gc_root(&self, path: &str) -> bool;
fn now(&self) -> Timestamp;
fn boot_now(&self) -> Timestamp;
fn sleep(&self, d: Millis);
fn kill_worker(&self, pid: u32) -> bool;
fn pid_alive(&self, pid: u32) -> bool;
// Provided method
fn floor_fixes(
&self,
_txn: &Transaction,
_floor: Option<GenerationId>,
) -> Result<Vec<String>, Outcome> { ... }
}Expand description
Everything the kernel needs from below. One generic parameter (no dyn, §6).
Required Associated Types§
type Gen: GenerationBackend
type Inv: InventoryBackend
Required Methods§
fn generations(&self) -> &Self::Gen
fn inventory(&self) -> &Self::Inv
Sourcefn execute_runtime(&self, t: &Transition, op: &OpId) -> Outcome
fn execute_runtime(&self, t: &Transition, op: &OpId) -> Outcome
Perform a ReobserveOnly transition’s backend effect (restart, stop,
runtime option, GC). Override bookkeeping is the kernel’s job, not this.
Sourcefn reobserve(&self, txn: &Transaction) -> Outcome
fn reobserve(&self, txn: &Transaction) -> Outcome
Settle, then observe and compare against the expectation; the outcome is recorded, never acted on (§12 step 7, UnitOp).
Sourcefn check(&self, txn: &Transaction, phase: CheckPhase) -> Verdict
fn check(&self, txn: &Transaction, phase: CheckPhase) -> Verdict
Run the applicable Readiness probes from the candidate’s UnitDefs and the installed core, plus the expectation and executor-owned requirements.
Sourcefn release_gc_root(&self, path: &str) -> bool
fn release_gc_root(&self, path: &str) -> bool
Remove a GC root (I3). Returns false if it could not be removed.
fn now(&self) -> Timestamp
Sourcefn boot_now(&self) -> Timestamp
fn boot_now(&self) -> Timestamp
The boot clock (CLOCK_BOOTTIME): leases, deadlines and waits (§12h).
fn sleep(&self, d: Millis)
Sourcefn kill_worker(&self, pid: u32) -> bool
fn kill_worker(&self, pid: u32) -> bool
SIGTERM then SIGKILL the process group via pidfd; true once confirmed dead.
fn pid_alive(&self, pid: u32) -> bool
Provided Methods§
Sourcefn floor_fixes(
&self,
_txn: &Transaction,
_floor: Option<GenerationId>,
) -> Result<Vec<String>, Outcome>
fn floor_fixes( &self, _txn: &Transaction, _floor: Option<GenerationId>, ) -> Result<Vec<String>, Outcome>
§12e, I25: the security fixes txn’s candidate brings, absent from
the floor generation and every generation between it and the
candidate (every earlier one, with no floor). Part of the commit:
an error here means the transaction does not commit yet.