pub struct HashObjectCommand {
pub executor: CommandExecutor,
pub paths: Vec<PathBuf>,
pub write: bool,
pub stdin: bool,
pub object_type: Option<String>,
}Expand description
Builder for git hash-object.
Fields§
§executor: CommandExecutorShared executor.
paths: Vec<PathBuf>Path(s) to hash.
write: bool-w: also write the object into the object database.
stdin: bool--stdin: read from stdin. (Currently unsupported in this wrapper; use
path() on a file containing the desired bytes.)
object_type: Option<String>-t <type>: override the object type.
Implementations§
Source§impl HashObjectCommand
impl HashObjectCommand
Sourcepub fn object_type(&mut self, t: impl Into<String>) -> &mut Self
pub fn object_type(&mut self, t: impl Into<String>) -> &mut Self
Override the object type (e.g. "tree", "commit", "tag").
Trait Implementations§
Source§impl Clone for HashObjectCommand
impl Clone for HashObjectCommand
Source§fn clone(&self) -> HashObjectCommand
fn clone(&self) -> HashObjectCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HashObjectCommand
impl Debug for HashObjectCommand
Source§impl Default for HashObjectCommand
impl Default for HashObjectCommand
Source§fn default() -> HashObjectCommand
fn default() -> HashObjectCommand
Returns the “default value” for a type. Read more
Source§impl GitCommand for HashObjectCommand
impl GitCommand for HashObjectCommand
Source§fn get_executor(&self) -> &CommandExecutor
fn get_executor(&self) -> &CommandExecutor
Borrow the shared executor.
Source§fn get_executor_mut(&mut self) -> &mut CommandExecutor
fn get_executor_mut(&mut self) -> &mut CommandExecutor
Mutably borrow the shared executor.
Source§fn 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.Source§fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run the command and decode its output into
Self::Output.Source§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 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. Read moreSource§fn 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.Source§fn 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.
Source§fn 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.Source§fn 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.
Auto Trait Implementations§
impl Freeze for HashObjectCommand
impl RefUnwindSafe for HashObjectCommand
impl Send for HashObjectCommand
impl Sync for HashObjectCommand
impl Unpin for HashObjectCommand
impl UnsafeUnpin for HashObjectCommand
impl UnwindSafe for HashObjectCommand
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