Skip to main content

Lab

Struct Lab 

Source
pub struct Lab<'r> { /* private fields */ }
Expand description

A run: a manifest under a name, on a runner.

Implementations§

Source§

impl Lab<'_>

Source

pub async fn down(&self, opts: &RunOptions, events: &dyn Events) -> Result<()>

Removes everything the run created (containers, networks, volumes).

§Errors

Fails, after its error event, when the run is recorded elsewhere, a down step fails, or the run’s state can’t be locked or written.

Source

pub async fn park(&self, mode: Park, events: &dyn Events) -> Result<()>

Stops the run, keeping what it created, with the manifest’s park steps for mode.

§Errors

Fails with not_parkable when the manifest has no steps for mode, with not_running when nothing of the run is there, and as Lab::down does for a step or the state.

Source

pub async fn resume( &self, opts: &RunOptions, events: &dyn Events, ) -> Result<Run>

Starts a parked run again, as it was: nothing is re-created, so inputs aren’t needed again.

§Errors

Fails with nothing_to_resume when nothing is left (the parked mark is dropped), and as Lab::up does for a tool, a step, a ready condition or the state.

Source

pub async fn check( &self, opts: &RunOptions, events: &dyn Events, ) -> Result<CheckReport>

Runs the lab’s checks against the running run.

§Errors

Fails with not_running when no target machine runs, and when a setup or teardown step fails. A failing check isn’t an error: the report says it (ok: false).

Source

pub async fn provision( &self, machine: Option<&str>, opts: &RunOptions, events: &dyn Events, ) -> Result<()>

Runs the lab’s set-up again on its running machines, every one or machine (a lab machine of the manifest), without rebuilding them: the manifest’s provision steps. The values given at launch aren’t kept by the runner: pass them again in opts.

§Errors

Fails with machine_unknown for a machine the lab doesn’t have, not_running when no target machine runs, unsupported when the manifest has no provision steps, and as Lab::up does for a step or the state.

Source§

impl Lab<'_>

Source

pub async fn up(&self, opts: &RunOptions, events: &dyn Events) -> Result<Run>

Starts the run: refused while it runs or runs elsewhere; a parked run is resumed (with Occupied::ResumeParked); leftovers are removed first.

§Errors

Fails, after its error event, when the run is up already (already_running) or recorded elsewhere (running_elsewhere); when a param, secret or tool is missing or refused; when a host port is taken (port_in_use); when a step fails or runs out of time (tool_failed, tool_missing, timeout); when a ready condition doesn’t hold (not_ready); or when the run’s state can’t be locked or written (locked, io).

Source§

impl<'r> Lab<'r>

Source

pub fn with_connection(self, secrets: Secrets) -> Lab<'r>

The lab with secrets, the values of its connection slots (an ESXi host’s password), delivered to every operation: status and park, which take no options, too. Kept in memory only, never stored; a value an operation’s options give wins.

Source

pub fn manifest(&self) -> &Manifest

The manifest.

Source

pub fn name(&self) -> &RunName

The run’s name.

Source

pub fn path(&self) -> &Path

The manifest’s file.

Source

pub async fn status(&self) -> Result<Status>

The run as it stands: read-only, never locked, and never an event.

§Errors

Fails when the engine can’t be asked (the status step fails or runs out of time) or the run’s record can’t be read.

Source

pub async fn outputs(&self) -> Result<Vec<OutputValue>>

The run’s outputs, read live.

§Errors

Fails as Lab::status does.

Trait Implementations§

Source§

impl Debug for Lab<'_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'r> !RefUnwindSafe for Lab<'r>

§

impl<'r> !UnwindSafe for Lab<'r>

§

impl<'r> Freeze for Lab<'r>

§

impl<'r> Send for Lab<'r>

§

impl<'r> Sync for Lab<'r>

§

impl<'r> Unpin for Lab<'r>

§

impl<'r> UnsafeUnpin for Lab<'r>

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