pub trait Action {
// Required methods
fn execute(&self) -> Result<(), DotfilesError>;
fn skip_in_ci(&self) -> bool;
// Provided method
fn check_conditions_and_execute(&self) -> Result<(), DotfilesError> { ... }
}Expand description
An action to be run by the dotfiles runtime.
Required Methods§
Sourcefn execute(&self) -> Result<(), DotfilesError>
fn execute(&self) -> Result<(), DotfilesError>
Executes the action.
Returns an error String describing the issue, this string can be used to log or display to the user.
Sourcefn skip_in_ci(&self) -> bool
fn skip_in_ci(&self) -> bool
Whether to skip this action in Continuous Integration environments.
Provided Methods§
Sourcefn check_conditions_and_execute(&self) -> Result<(), DotfilesError>
fn check_conditions_and_execute(&self) -> Result<(), DotfilesError>
Checks that the conditions allow for executing this action, and if so executes it according to [execute(&self)].
If conditions don’t pass it simply skips and returns Ok(())
At this moment the only condition that is supported is whether the action should be skipped in CI, see [skip_in_ci(&self)].
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".