Skip to main content

Command

Enum Command 

Source
#[non_exhaustive]
pub enum Command { VersionString, Login { user_name: String, password: String, }, Logout, LoadFile { path: String, }, Start { sequence: String, }, Run { sequence_file: String, sequence: String, }, Terminate { execution_id: i32, }, Control { execution_id: Option<i32>, control: ExecutionControl, }, ReadValue { execution_id: i32, lookup: String, }, Shutdown, }
Expand description

A request from a front end, addressed to the host that owns the engine.

Every variant is something the engine can do on its own thread, because that is where the host will run it. Nothing here returns a COM reference: a command’s answer is a Response, which is data.

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.
§

VersionString

Ask the engine what it is.

Answers with Engine.VersionString and Engine.Is64Bit, which are the members it reads. Named for them rather than for a greeting: a command called hello describes the conversation, not the engine operation, and somebody reading the vendor documentation would not find it.

Cheap, and worth sending first: it distinguishes “the socket connected” from “the engine is up”, which are not the same and fail differently.

§

Login

Log a user in, by name.

The host looks the account up, checks the password, and makes it current. An account with no password takes an empty string, which is ordinary on a station where the operator is identified but not authenticated.

Fields

§user_name: String

The account’s login name.

§password: String

The password to check. Empty when the account has none.

§

Logout

Log the current user out, leaving nobody logged in.

§

LoadFile

Open a sequence file and hold it, without running anything.

Separate from Start because loading is where a bad path or a missing dependency shows up, and a panel wants that answer before it offers a run button.

Fields

§path: String

Path to the sequence file, as the host’s filesystem sees it.

§

Start

Start a sequence in the file already loaded.

Fields

§sequence: String

Which sequence to run.

§

Run

Load a sequence file and start one of its sequences in one step.

Fields

§sequence_file: String

Path to the sequence file, as the host’s filesystem sees it.

§sequence: String

Which sequence to run. MainSequence unless the file says otherwise.

§

Terminate

Ask a running execution to stop.

Termination, not abort: cleanup still runs, so hardware is left safe.

Fields

§execution_id: i32

Which execution, as reported by MessageEvent::execution_id.

§

Control

Change what a running execution is doing.

One command carrying a verb rather than six commands, so the wire shape stays stable as more controls land, and so a panel acting on whatever is running can leave execution_id out instead of tracking it.

The engine binding has had these members for a while. Without this variant none were reachable from a client, which left a panel able to start a run and stop it and do nothing in between.

Fields

§execution_id: Option<i32>

Which execution. Absent means whatever the host has running.

§control: ExecutionControl

What to do to it.

§

ReadValue

Read a value out of a running execution’s context.

lookup is an ordinary property path, Locals.Result or FileGlobals.SerialNumber. This is how a panel gets data it was not pushed: the host resolves the path and answers with the subtree as data, because the reference itself could never leave the process.

Fields

§execution_id: i32

Which execution to read from.

§lookup: String

The property path to resolve.

§

Shutdown

Stop the host after the current run finishes.

Implementations§

Source§

impl Command

Source

pub const fn name(&self) -> &'static str

A short name for logging, without rendering the whole command.

Source

pub const fn is_control(&self) -> bool

Whether this command changes what the station is doing.

A host that serves more than one panel wants to treat these differently from reads: two observers are fine, two controllers are a decision somebody has to make.

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

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: &Command) -> 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.