#[non_exhaustive]pub struct PreConnectStep {
pub command: String,
pub save_output_to: Option<String>,
pub timeout_secs: Option<u32>,
pub required: bool,
}Expand description
One pre-connect command.
The command string is handed to sh -c so users can compose
pipes / redirections without us shipping a parser. Stdout is
captured (trimmed of trailing whitespace) and, when
save_output_to is set, stored under that key in the
pre-connect variable map.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.command: StringShell command line. Run via sh -c.
save_output_to: Option<String>When set, the trimmed stdout of command is stored under
this key in the variable map exposed to the rest of the
connection params via ${preconnect:NAME} placeholders.
timeout_secs: Option<u32>Time budget for this step. Defaults to 30 seconds. The whole pre-connect sequence is capped at the sum of its steps’ timeouts so a wedged kubectl call cannot freeze the UI.
required: boolWhen true, a non-zero exit aborts the entire connection
open. When false, the failure is logged and the sequence
continues to the next step. Defaults to true.
Implementations§
Source§impl PreConnectStep
impl PreConnectStep
Sourcepub fn new(command: impl Into<String>) -> Self
pub fn new(command: impl Into<String>) -> Self
Build a step from the bare command line. Convenience for tests and any future config-tooling that wants to assemble a step without going through serde.
pub fn with_save_output_to(self, key: impl Into<String>) -> Self
pub const fn with_timeout_secs(self, secs: u32) -> Self
pub const fn with_required(self, required: bool) -> Self
Trait Implementations§
Source§impl Clone for PreConnectStep
impl Clone for PreConnectStep
Source§fn clone(&self) -> PreConnectStep
fn clone(&self) -> PreConnectStep
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 PreConnectStep
impl Debug for PreConnectStep
Source§impl Default for PreConnectStep
impl Default for PreConnectStep
Source§fn default() -> PreConnectStep
fn default() -> PreConnectStep
Source§impl<'de> Deserialize<'de> for PreConnectStep
impl<'de> Deserialize<'de> for PreConnectStep
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PreConnectStep
Source§impl PartialEq for PreConnectStep
impl PartialEq for PreConnectStep
Source§fn eq(&self, other: &PreConnectStep) -> bool
fn eq(&self, other: &PreConnectStep) -> bool
self and other values to be equal, and is used by ==.