pub struct CommandSpec {
pub program: String,
pub args: Vec<String>,
pub env: BTreeMap<String, String>,
pub clear_env: bool,
pub cwd: Option<PathBuf>,
pub purpose: String,
pub stage: Option<ProvisionStage>,
pub parallel_group: Option<u32>,
pub creates_target: bool,
pub ssh_destination: Option<String>,
/* private fields */
}Fields§
§program: String§args: Vec<String>§env: BTreeMap<String, String>§clear_env: boolReplace ambient process variables with the explicitly supplied environment.
cwd: Option<PathBuf>§purpose: String§stage: Option<ProvisionStage>§parallel_group: Option<u32>Commands that share this marker and appear consecutively in a plan’s
command list may run concurrently under
CommandPlan::execute_concurrent. Commands without a marker, or
whose neighbors do not share it, keep running strictly in plan order.
creates_target: boolWhether this command brings the session’s target into existence. Every command after it in a provisioning plan runs against a target that already exists, so a later failure owes that target’s teardown.
ssh_destination: Option<String>The SSH destination this command opens a connection to, when it does.
Tagged commands pass through SshAdmission so the daemon never
exceeds the remote sshd’s MaxStartups budget, and a transport
rejection is retried rather than reported as a command failure.
Implementations§
Source§impl CommandSpec
impl CommandSpec
pub fn new( program: impl Into<String>, args: impl IntoIterator<Item = impl Into<String>>, ) -> CommandSpec
pub fn purpose(self, purpose: impl Into<String>) -> CommandSpec
pub fn stage(self, stage: ProvisionStage) -> CommandSpec
Sourcepub fn parallel_group(self, group: u32) -> CommandSpec
pub fn parallel_group(self, group: u32) -> CommandSpec
Mark this command as eligible to run concurrently with its plan-adjacent siblings that share the same group.
Sourcepub fn ssh_destination(self, destination: impl Into<String>) -> CommandSpec
pub fn ssh_destination(self, destination: impl Into<String>) -> CommandSpec
Record that this command opens an ssh connection to destination,
which is the host (or user@host) argument, never an option value.
Sourcepub fn creates_target(self) -> CommandSpec
pub fn creates_target(self) -> CommandSpec
Mark this command as the one that creates the session’s target.
Sourcepub fn with_sensitive_stdin(self, input: Vec<u8>) -> CommandSpec
pub fn with_sensitive_stdin(self, input: Vec<u8>) -> CommandSpec
Feed private file content through the shared concurrent pipe handler. The bytes stay out of argv, environments, serialization, and Debug.
Trait Implementations§
Source§impl Clone for CommandSpec
impl Clone for CommandSpec
Source§fn clone(&self) -> CommandSpec
fn clone(&self) -> CommandSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommandSpec
impl Debug for CommandSpec
Source§impl<'de> Deserialize<'de> for CommandSpec
impl<'de> Deserialize<'de> for CommandSpec
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CommandSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CommandSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for CommandSpec
Source§impl PartialEq for CommandSpec
impl PartialEq for CommandSpec
Source§impl Serialize for CommandSpec
impl Serialize for CommandSpec
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CommandSpec
Auto Trait Implementations§
impl Freeze for CommandSpec
impl RefUnwindSafe for CommandSpec
impl Send for CommandSpec
impl Sync for CommandSpec
impl Unpin for CommandSpec
impl UnsafeUnpin for CommandSpec
impl UnwindSafe for CommandSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more