pub struct Git { /* private fields */ }Expand description
Invokes git with a fixed set of global options in front of every subcommand.
Implementations§
Source§impl Git
impl Git
pub fn new(globals: Vec<OsString>) -> Self
Sourcepub fn capture<I, S>(
&self,
directory: Option<&Path>,
args: I,
) -> Result<Vec<u8>>
pub fn capture<I, S>( &self, directory: Option<&Path>, args: I, ) -> Result<Vec<u8>>
Runs git and returns its stdout, or an error if it failed or could not start.
Sourcepub fn passthrough<I, S>(
&self,
directory: Option<&Path>,
args: I,
) -> Result<ExitStatus>
pub fn passthrough<I, S>( &self, directory: Option<&Path>, args: I, ) -> Result<ExitStatus>
Runs git with the caller’s stdio, so its output is indistinguishable from ours.
Sourcepub fn capture_with_input<I, S>(
&self,
directory: Option<&Path>,
args: I,
input: &[u8],
) -> Result<Vec<u8>>
pub fn capture_with_input<I, S>( &self, directory: Option<&Path>, args: I, input: &[u8], ) -> Result<Vec<u8>>
Runs git with input on its stdin and returns its stdout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Git
impl RefUnwindSafe for Git
impl Send for Git
impl Sync for Git
impl Unpin for Git
impl UnsafeUnpin for Git
impl UnwindSafe for Git
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