Skip to main content

RunOptions

Struct RunOptions 

Source
#[non_exhaustive]
pub struct RunOptions { pub provider: Option<Provider>, pub secrets: Secrets, pub host_label: Option<String>, pub lifetime: Option<Duration>, pub env: BTreeMap<String, String>, pub reveal: bool, pub docker_context: Option<String>, pub operation: Option<OperationId>, }
Expand description

The options of one operation.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§provider: Option<Provider>

The Vagrant provider (vagrant up --provider), for a Vagrant project.

§secrets: Secrets

Sensitive values every tool of the operation gets, as its format reads them (each by its name; Terraform also gets it as TF_VAR_<name>): never stored, never written to a file, masked in every event. Pass them to every operation.

§host_label: Option<String>

What the embedder calls the place the run is on (a server or account id): recorded, so a later operation asked for elsewhere is refused (running_elsewhere).

§lifetime: Option<Duration>

How long the run may live from its up: recorded as its expiry (crate::RunRecord’s expires_at), which the reaper reads (crate::Runner::expired).

§env: BTreeMap<String, String>

Values every tool of the operation gets, by name, as its format reads them (Compose’s ${NAME}, a Vagrantfile’s ENV, Terraform’s TF_VAR_NAME too). Never stored: pass them to every operation.

§reveal: bool

A status read only: each sensitive output’s own value instead of ***, for its caller to use (an admin password a project gives back). Never in an event, never stored; a service gives it only over its owner-only endpoint. Off by default.

§docker_context: Option<String>

The Docker context the run’s docker calls go to (docker --context <it>), whatever the current one is: given at up (or any later operation), recorded with the run, and used by every later operation and read that gives none. None: the current context, as docker picks it.

§operation: Option<OperationId>

The journaled operation this one is: a row a service queued (Tx::queue_operation), which the operation begins instead of journaling a new one.

Implementations§

Source§

impl RunOptions

Source

pub fn new() -> RunOptions

No value, no secret, nothing recorded about the place.

Source

pub fn with_env( self, name: impl Into<String>, value: impl Into<String>, ) -> RunOptions

Sets variable name to value for every tool of the operation.

Source

pub fn with_secrets(self, secrets: Secrets) -> RunOptions

Gives the tools the sensitive values secrets.

Source

pub fn with_operation(self, id: OperationId) -> RunOptions

Runs as the queued operation id of the home’s journal (crate::store::Tx::queue_operation).

Source

pub fn with_host_label(self, label: impl Into<String>) -> RunOptions

Records the place the run is on as label.

Source

pub fn with_provider(self, provider: Provider) -> RunOptions

Runs with Vagrant provider provider.

Source

pub fn with_docker_context(self, context: impl Into<String>) -> RunOptions

Sends the run’s docker calls to Docker context context (RunOptions::docker_context).

Source

pub fn with_lifetime(self, lifetime: Duration) -> RunOptions

Lets the run live lifetime from its up.

Source

pub fn with_reveal(self) -> RunOptions

A status read that gives the sensitive outputs’ own values (RunOptions::reveal).

Trait Implementations§

Source§

impl Clone for RunOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RunOptions

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RunOptions

Source§

fn default() -> Self

Returns the “default value” for a type. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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