pub struct Git { /* private fields */ }Expand description
git struct - the core of rsgit
to initialize, see Git::new
Implementations§
Source§impl Git
impl Git
Sourcepub fn new<T>(items: T) -> Git
pub fn new<T>(items: T) -> Git
Creates a new instance of the Git structure
The provided items must be able to be coerced into a Vec<String>
Returned is an instance of the Git struct
§Examples
use rsgit::Git;
let cmd = Git::new(vec!["log", "--shortstat"]);Sourcepub fn stream(&self) -> Result<Success, Failure>
pub fn stream(&self) -> Result<Success, Failure>
Runs the specified commands, prefixed by git
Returns either success or failure
stdin, stdout and stderr are all inherited from the parent
§Examples
use rsgit::{IsFailure, Git};
let cmd = Git::new(vec!["log", "--shortstat"]);
let output = cmd.stream();
println!("git log --shortstat returned code {}", output.code());Sourcepub fn run(&self) -> Result<Success, Failure>
pub fn run(&self) -> Result<Success, Failure>
Runs the specified commands, prefixed by git
Returns either success or failure
stdin, stdout and stderr are all returned in an object
§Examples
use rsgit::{IsFailure, Git};
let cmd = Git::new(vec!["log", "--shortstat"]);
let output = cmd.run();
println!("The output of git log --shortstat was {}", output.stdout().unwrap_or_default());Auto Trait Implementations§
impl Freeze for Git
impl RefUnwindSafe for Git
impl Send for Git
impl Sync for Git
impl Unpin 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