pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
Sourcepub fn open<P: AsRef<Path>>(
path: P,
encoding: &str,
configs: &[&str],
) -> Result<Client, HglibError>
pub fn open<P: AsRef<Path>>( path: P, encoding: &str, configs: &[&str], ) -> Result<Client, HglibError>
Open a new hglib client
§Example
extern crate hglib;
use hglib::{commit, hg, init, log, Basic, Client, HG};
use std::fs::File;
use std::io::Write;
fn main() {
let path = "my_hg_repo";
assert!(HG!(init, dest = &path).is_ok());
let mut client = Client::open(&path, "UTF-8", &[]).unwrap();
let path = client.get_path();
let mut file = File::create(path.join("hello.world")).unwrap();
file.write_all(b"Hello, world!").unwrap();
hg!(
client,
commit,
message = "My first commit",
addremove = true,
user = "foo@bar.com"
)
.unwrap();
let rev = hg!(client, log).unwrap();
println!("{:?}", rev);
}
Sourcepub fn close(&mut self) -> Result<(), HglibError>
pub fn close(&mut self) -> Result<(), HglibError>
Close the client
pub fn encoding(&self) -> &str
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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