pub struct Script {
pub name: String,
pub command: String,
pub timeout: Duration,
pub test_command: Option<String>,
pub require_test: bool,
pub path: PathBuf,
}Expand description
Runtime representation of a script with resolved paths
Fields§
§name: String§command: String§timeout: Duration§test_command: Option<String>§require_test: bool§path: PathBufImplementations§
Source§impl Script
impl Script
Sourcepub fn new(config: ScriptConfig, path: PathBuf) -> Self
pub fn new(config: ScriptConfig, path: PathBuf) -> Self
Create a new script from configuration and path
Sourcepub fn from_toml_file(path: &PathBuf) -> Result<Self>
pub fn from_toml_file(path: &PathBuf) -> Result<Self>
Load a script from a goblin.toml file
Sourcepub fn from_toml_str(toml_str: &str, path: PathBuf) -> Result<Self>
pub fn from_toml_str(toml_str: &str, path: PathBuf) -> Result<Self>
Load a script from a TOML string with a specified path
Sourcepub fn working_directory(&self) -> &PathBuf
pub fn working_directory(&self) -> &PathBuf
Get the working directory for this script
Sourcepub fn get_command(&self, args: &[String]) -> String
pub fn get_command(&self, args: &[String]) -> String
Get the full command to execute for this script
Sourcepub fn get_test_command(&self) -> Option<&str>
pub fn get_test_command(&self) -> Option<&str>
Get the test command if available
Trait Implementations§
Source§impl From<ScriptConfig> for Script
impl From<ScriptConfig> for Script
Source§fn from(config: ScriptConfig) -> Self
fn from(config: ScriptConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Script
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnwindSafe for Script
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