Skip to main content

Command

Enum Command 

Source
#[non_exhaustive]
pub enum Command {
Show 33 variants Hello { protocol: u32, }, Up { target: Target, options: OpOptions, lifetime_s: Option<u64>, }, Down { target: Target, options: OpOptions, }, Park { target: Target, options: OpOptions, mode: Park, }, Resume { target: Target, options: OpOptions, }, Update { target: Target, options: OpOptions, }, Attach { target: Target, options: OpOptions, machine: String, }, Retire { target: Target, options: OpOptions, machine: String, }, Package { target: Target, options: OpOptions, machine: String, output: PathBuf, }, Provision { target: Target, options: OpOptions, machine: Option<String>, with: Option<String>, }, Exec { target: Target, options: OpOptions, machine: String, argv: Vec<String>, }, Status { run: RunName, target: Option<Target>, options: OpOptions, }, Variables { target: Target, }, List, Record { run: RunName, }, Forget { run: RunName, }, Expired, ConsoleCommand { run: RunName, target: Option<Target>, machine: String, user: Option<String>, }, GraphicalConsole { run: RunName, target: Option<Target>, options: OpOptions, machine: String, }, NativeConsole { run: RunName, target: Option<Target>, options: OpOptions, machine: String, }, ServiceEndpoints { run: RunName, target: Option<Target>, options: OpOptions, }, Usage { run: RunName, target: Option<Target>, options: OpOptions, }, PublicKey, Downloads, RemoveDownloads { which: DownloadsToRemove, }, AdoptDownloads { adopted: Vec<DownloadToAdopt>, }, AddressBlocksInUse { except: Option<RunName>, docker_context: Option<String>, }, Operations { run: RunName, limit: u32, }, Cancel { operation: OperationId, }, Subscribe { run: Option<RunName>, after: Option<EventCursor>, }, Unsubscribe, Shutdown, ShutdownIfIdle,
}
Expand description

What a request asks of the service.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Hello

Opens the conversation (must come first).

Fields

§protocol: u32

The protocol the client speaks (PROTOCOL).

§

Up

Start the run (a parked run is resumed).

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§lifetime_s: Option<u64>

How long a run that stops itself may live, in seconds.

§

Down

Remove everything the run created.

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§

Park

Stop the run, keeping what it created.

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§mode: Park

Paused or shut down.

§

Resume

Start a parked run again.

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§

Update

Bring the running run up to date with its project.

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§

Attach

Bring a machine of the project that isn’t running into the running run.

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§machine: String

The machine.

§

Retire

Take a machine out of the running run.

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§machine: String

The machine.

§

Package

Save a machine of the running run as a box file (Vagrant’s package).

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§machine: String

The machine.

§output: PathBuf

The box file written.

§

Provision

Run the set-up again on the running machines.

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§machine: Option<String>

Only this machine.

§with: Option<String>

Only the provisioner of this name (Vagrant’s --provision-with).

§

Exec

Runs a command in a machine of the run, with no terminal; its result says how it ended.

Fields

§target: Target

The run.

§options: OpOptions

The values it runs with.

§machine: String

The machine.

§argv: Vec<String>

The command and its arguments.

§

Status

The run’s status (not queued: it reads). target is needed for a run not recorded yet; without it the run is reopened as recorded.

Fields

§run: RunName

The run.

§target: Option<Target>

Where it is opened from (default: where its record says).

§options: OpOptions

The values and secrets its read gives the tools, beside the recorded ones (a server’s API token, for its machines’ states there).

§

Variables

The input variables a Terraform folder declares (not queued: it reads the folder’s files, and runs nothing).

Fields

§target: Target

The folder (its name is unused).

§

List

Every recorded run.

§

Record

One run’s record (not queued: it reads the store); none for a run never recorded.

Fields

§run: RunName

The run.

§

Forget

Forgets a run’s record: what the run created is left as it is. Refused while an operation of the run is queued or running.

Fields

§run: RunName

The run.

§

Expired

The recorded runs whose lifetime passed and that may still hold something: what a reaper takes down (a down each, given the values and secrets the run needs).

§

ConsoleCommand

The command that opens an interactive console into a machine of a run (not queued: nothing runs), for the client to run in its own terminal.

Fields

§run: RunName

The run.

§target: Option<Target>

Where it is opened from (default: where its record says).

§machine: String

The machine.

§user: Option<String>

The account to open it as.

§

GraphicalConsole

A running machine’s graphical console (not queued: it reads). Reached through an SSH tunnel, the tunnel stays open for as long as the connection that asked: a client asks on a connection of its own, closed when the viewer is done; the service writes Reply::ConsoleClosed and closes it when the tunnel ends first.

Fields

§run: RunName

The run.

§target: Option<Target>

Where it is opened from (default: where its record says).

§options: OpOptions

The values and secrets the hypervisor is asked with (a server’s address and token).

§machine: String

The machine.

§

NativeConsole

What opens a running machine in its hypervisor’s own app (not queued: it reads).

Fields

§run: RunName

The run.

§target: Option<Target>

Where it is opened from (default: where its record says).

§options: OpOptions

The values and secrets the hypervisor is asked with.

§machine: String

The machine.

§

ServiceEndpoints

The service endpoints a run publishes, each where this computer reaches it: as the run gives it, or at a local forward through the run’s jump host, which the service keeps open (not queued: it reads).

Fields

§run: RunName

The run.

§target: Option<Target>

Where it is opened from (default: where its record says).

§options: OpOptions

The values and secrets its outputs are read with.

§

Usage

What each running machine of a run uses now (CPU and memory), as its engine samples it once; none for a format whose tool reports no per-machine figure (not queued: it reads).

Fields

§run: RunName

The run.

§target: Option<Target>

Where it is opened from (default: where its record says).

§options: OpOptions

The values and secrets its tools are run with.

§

PublicKey

The public half of the runner’s SSH key, one line (the key is made when there is none): what the client authorizes where a run’s SSH goes.

§

Downloads

What the runs’ own downloads fetched and the home’s store records (the images a Compose start’s pull pulled, the boxes a Vagrant up added), each with its size when it can be read (not queued: it reads).

§

RemoveDownloads

Removes the recorded downloads which names, each on its own: one its tool refuses (in use) is said in its outcome and kept, the others go on. Nothing the store doesn’t record is removed (not queued).

Fields

§which: DownloadsToRemove

All, or those of the given ids.

§

AdoptDownloads

Adopts downloads fetched outside the runs (by an earlier program’s own record) into the home’s record, each one on this computer now as it was fetched: they are listed and removed like the runs’ own (not queued).

Fields

§adopted: Vec<DownloadToAdopt>

The downloads to adopt.

§

AddressBlocksInUse

The IPv4 address blocks the engine’s networks hold, but those of a run’s own networks: what a deployment’s networks must stay clear of (not queued).

Fields

§except: Option<RunName>

The run whose own networks don’t count.

§docker_context: Option<String>

The Docker context of the engine asked; the current one when none.

§

Operations

The run’s latest operations, newest first.

Fields

§run: RunName

The run.

§limit: u32

At most this many.

§

Cancel

Cancels an operation: a queued one never begins, a running one is cut short (its tools stopped).

Fields

§operation: OperationId

The operation.

§

Subscribe

Turns the connection into a subscription: the events after after (every one the service keeps when None), then the live ones, of one run or every run.

Fields

§run: Option<RunName>

Only this run’s.

§after: Option<EventCursor>

Resumes after this cursor (a reconnecting client’s last).

§

Unsubscribe

Ends the connection’s subscription.

§

Shutdown

Stops the service: queued operations are dropped, running ones cancelled and their tools stopped, then it exits.

§

ShutdownIfIdle

Stops the service only when no operation is queued or running (Reply::Ok: it takes no new one, and exits); else refused with Reply::Busy, and nothing changes. Every protocol takes it, from a client of any protocol (see the module’s documentation).

Implementations§

Source§

impl Command

Source

pub fn op(&self) -> Option<Op>

The operation it queues, when it queues one.

Source

pub fn is_question(&self) -> bool

Whether it asks the service about the home, running no operation: a run’s status or record, forgetting it, the expired runs, a way into a machine, its endpoints, the key, the downloads and their removal.

Source

pub fn target(&self) -> Option<(&Target, &OpOptions)>

The run and the options of an operation command.

Trait Implementations§

Source§

impl Clone for Command

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 Command

Source§

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

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

impl<'de> Deserialize<'de> for Command

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Command

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Command

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Command

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
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