pub struct Precondition {
pub command: String,
pub message: Option<String>,
pub shell: Option<Shell>,
pub work_dir: Option<String>,
pub verbose: Option<bool>,
}
Expand description
This struct represents a precondition that must be met before a task can be executed.
Fields§
§command: String
The command to run
message: Option<String>
The message to display if the command fails
shell: Option<Shell>
The shell to use to run the command
work_dir: Option<String>
The working directory to run the command in
verbose: Option<bool>
Show verbose output
Implementations§
Source§impl Precondition
impl Precondition
pub fn execute(&self, context: &TaskContext) -> Result<()>
Trait Implementations§
Source§impl Debug for Precondition
impl Debug for Precondition
Source§impl Default for Precondition
impl Default for Precondition
Source§fn default() -> Precondition
fn default() -> Precondition
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Precondition
impl<'de> Deserialize<'de> for Precondition
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Precondition
impl RefUnwindSafe for Precondition
impl Send for Precondition
impl Sync for Precondition
impl Unpin for Precondition
impl UnwindSafe for Precondition
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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