#[non_exhaustive]pub struct ExecStepConfig {
pub allowed_success_codes: Vec<i32>,
pub interpreter: Interpreter,
pub executable: Option<Executable>,
/* private fields */
}Expand description
Common configurations for an ExecStep.
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.allowed_success_codes: Vec<i32>Defaults to [0]. A list of possible return values that the execution can return to indicate a success.
interpreter: InterpreterThe script interpreter to use to run the script. If no interpreter is specified the script will be executed directly, which will likely only succeed for scripts with [shebang lines] (https://en.wikipedia.org/wiki/Shebang_(Unix)).
executable: Option<Executable>Location of the executable.
Implementations§
Source§impl ExecStepConfig
impl ExecStepConfig
Sourcepub fn set_allowed_success_codes<T, V>(self, v: T) -> Self
pub fn set_allowed_success_codes<T, V>(self, v: T) -> Self
Sets the value of allowed_success_codes.
§Example
let x = ExecStepConfig::new().set_allowed_success_codes([1, 2, 3]);Sourcepub fn set_interpreter<T: Into<Interpreter>>(self, v: T) -> Self
pub fn set_interpreter<T: Into<Interpreter>>(self, v: T) -> Self
Sets the value of interpreter.
§Example
use google_cloud_osconfig_v1::model::exec_step_config::Interpreter;
let x0 = ExecStepConfig::new().set_interpreter(Interpreter::Shell);
let x1 = ExecStepConfig::new().set_interpreter(Interpreter::Powershell);Sourcepub fn set_executable<T: Into<Option<Executable>>>(self, v: T) -> Self
pub fn set_executable<T: Into<Option<Executable>>>(self, v: T) -> Self
Sets the value of executable.
Note that all the setters affecting executable are mutually
exclusive.
§Example
use google_cloud_osconfig_v1::model::exec_step_config::Executable;
let x = ExecStepConfig::new().set_executable(Some(Executable::LocalPath("example".to_string())));Sourcepub fn local_path(&self) -> Option<&String>
pub fn local_path(&self) -> Option<&String>
The value of executable
if it holds a LocalPath, None if the field is not set or
holds a different branch.
Sourcepub fn set_local_path<T: Into<String>>(self, v: T) -> Self
pub fn set_local_path<T: Into<String>>(self, v: T) -> Self
Sets the value of executable
to hold a LocalPath.
Note that all the setters affecting executable are
mutually exclusive.
§Example
let x = ExecStepConfig::new().set_local_path("example");
assert!(x.local_path().is_some());
assert!(x.gcs_object().is_none());Sourcepub fn gcs_object(&self) -> Option<&Box<GcsObject>>
pub fn gcs_object(&self) -> Option<&Box<GcsObject>>
The value of executable
if it holds a GcsObject, None if the field is not set or
holds a different branch.
Sourcepub fn set_gcs_object<T: Into<Box<GcsObject>>>(self, v: T) -> Self
pub fn set_gcs_object<T: Into<Box<GcsObject>>>(self, v: T) -> Self
Sets the value of executable
to hold a GcsObject.
Note that all the setters affecting executable are
mutually exclusive.
§Example
use google_cloud_osconfig_v1::model::GcsObject;
let x = ExecStepConfig::new().set_gcs_object(GcsObject::default()/* use setters */);
assert!(x.gcs_object().is_some());
assert!(x.local_path().is_none());Trait Implementations§
Source§impl Clone for ExecStepConfig
impl Clone for ExecStepConfig
Source§fn clone(&self) -> ExecStepConfig
fn clone(&self) -> ExecStepConfig
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 ExecStepConfig
impl Debug for ExecStepConfig
Source§impl Default for ExecStepConfig
impl Default for ExecStepConfig
Source§fn default() -> ExecStepConfig
fn default() -> ExecStepConfig
Source§impl Message for ExecStepConfig
impl Message for ExecStepConfig
Source§impl PartialEq for ExecStepConfig
impl PartialEq for ExecStepConfig
impl StructuralPartialEq for ExecStepConfig
Auto Trait Implementations§
impl Freeze for ExecStepConfig
impl RefUnwindSafe for ExecStepConfig
impl Send for ExecStepConfig
impl Sync for ExecStepConfig
impl Unpin for ExecStepConfig
impl UnsafeUnpin for ExecStepConfig
impl UnwindSafe for ExecStepConfig
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request