Skip to main content

Runner

Struct Runner 

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

The runner.

Implementations§

Source§

impl Runner

Source

pub async fn adopt( &self, manifest: &Path, adoption: Adoption, ) -> Result<RunRecord>

Takes over the Terraform deployment adoption describes as a run of the manifest at manifest (pub async fn adopt(&self, manifest: &Path, adoption: Adoption) -> Result<RunRecord>): its state moves into the run’s state folder, and the run is recorded as up, with the manifest’s params among adoption.params. A run whose record an earlier down left absent (its state gone with it) is taken over too, its record replaced. Once taken over, the old folder holds no state: taking it over again is refused, never a second copy.

§Errors

Fails with adopt_refused when the manifest isn’t a Terraform one, when the run already has a record that isn’t absent or a state, or when the old folder holds no state; with locked while another operation holds the run; with manifest_invalid or io when the manifest can’t be read; and with io when a file can’t be moved or the record written (the state is put back then).

Source§

impl Runner

Source

pub fn expired(&self, now: SystemTime) -> Result<Vec<RunRecord>>

The recorded runs whose expiry passed at now and whose last operation didn’t leave them absent: the reaper’s input. Reads files only.

§Errors

Fails with io when a record can’t be read.

Source

pub async fn orphans( &self, cloud: Cloud, place: &Place, now: SystemTime, ) -> Result<Orphans>

What cloud holds in place tagged with an expiry past now that no recorded run’s Terraform state covers. A command line that is missing or fails is said in Orphans::unread, never an error: the sweep goes on.

§Errors

Fails with io when a record or a run’s state can’t be read.

Source§

impl Runner

Source

pub fn new(config: RunnerConfig) -> Result<Runner>

A runner with config; its home’s runs/ folder is created owner-only.

§Errors

Fails with io when the home’s runs/ folder can’t be created.

Source

pub fn add_hooks(&mut self, hooks: Arc<dyn Hooks>)

Adds the embedder’s hooks around lifecycle edges.

Source

pub fn open( &self, manifest: &Path, name: Option<RunName>, ) -> Result<Running<'_>>

Reads and checks the manifest at manifest, as run name (default: the run’s name).

§Errors

Fails as load_manifest does; with run_name when the run’s name can’t name a run; with unsupported when this runner can’t run the manifest (its driver, a delivery, this host).

Source

pub fn runs(&self) -> Result<Vec<RunRecord>>

Every recorded run, with the state its last operation left it in. Reads files only.

§Errors

Fails with io when a record can’t be read.

Source

pub fn events(&self, name: &RunName) -> Result<Vec<Event>>

Run name’s logged events, oldest first.

§Errors

Fails with io when the run’s event log can’t be read.

Source

pub async fn ssh_public_key(&self) -> Result<String>

The public half of the runner’s SSH key, one line: what an embedder authorizes where a run’s SSH goes (a Proxmox node it jumps through). The key is made when the runner has none.

§Errors

Fails with tool_missing when ssh-keygen isn’t installed, tool_failed or timeout when it can’t make the key, and io when the runner’s ssh/ folder can’t be created.

Source

pub fn in_flight(&self) -> Vec<(RunName, Op)>

The operations in flight in this runner (a quit guard, a UI rehydrating).

Trait Implementations§

Source§

impl Debug for Runner

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Runner

§

impl !RefUnwindSafe for Runner

§

impl !UnwindSafe for Runner

§

impl Send for Runner

§

impl Sync for Runner

§

impl Unpin for Runner

§

impl UnsafeUnpin for Runner

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more