pub trait GitCommand {
type Output;
Show 13 methods
// Required methods
fn get_executor(&self) -> &CommandExecutor;
fn get_executor_mut(&mut self) -> &mut CommandExecutor;
fn build_command_args(&self) -> Vec<String>;
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn execute_raw<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self { ... }
fn args<I, S>(&mut self, args: I) -> &mut Self
where I: IntoIterator<Item = S>,
S: AsRef<OsStr> { ... }
fn flag(&mut self, flag: &str) -> &mut Self { ... }
fn option(&mut self, key: &str, value: &str) -> &mut Self { ... }
fn current_dir<P: Into<PathBuf>>(&mut self, dir: P) -> &mut Self { ... }
fn env<K: Into<OsString>, V: Into<OsString>>(
&mut self,
key: K,
value: V,
) -> &mut Self { ... }
fn with_timeout(&mut self, timeout: Duration) -> &mut Self { ... }
fn with_timeout_secs(&mut self, seconds: u64) -> &mut Self { ... }
}Expand description
Trait implemented by every git subcommand wrapper.
Required Associated Types§
Required Methods§
Sourcefn get_executor(&self) -> &CommandExecutor
fn get_executor(&self) -> &CommandExecutor
Borrow the shared executor.
Sourcefn get_executor_mut(&mut self) -> &mut CommandExecutor
fn get_executor_mut(&mut self) -> &mut CommandExecutor
Mutably borrow the shared executor.
Sourcefn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build the full argument vector (subcommand + flags + positionals)
excluding the leading git program.
Provided Methods§
Sourcefn execute_raw<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn execute_raw<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Spawn git with the given arguments and return the raw output.
Command implementations call this from execute() and then decode
stdout into their typed output.
Sourcefn current_dir<P: Into<PathBuf>>(&mut self, dir: P) -> &mut Self
fn current_dir<P: Into<PathBuf>>(&mut self, dir: P) -> &mut Self
Run git in the given working directory.
Sourcefn env<K: Into<OsString>, V: Into<OsString>>(
&mut self,
key: K,
value: V,
) -> &mut Self
fn env<K: Into<OsString>, V: Into<OsString>>( &mut self, key: K, value: V, ) -> &mut Self
Set an environment variable for this invocation.
Sourcefn with_timeout(&mut self, timeout: Duration) -> &mut Self
fn with_timeout(&mut self, timeout: Duration) -> &mut Self
Cap execution time. On expiry the process is killed and
Error::Timeout is returned.
Sourcefn with_timeout_secs(&mut self, seconds: u64) -> &mut Self
fn with_timeout_secs(&mut self, seconds: u64) -> &mut Self
Convenience: set timeout in whole seconds.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.