pub struct Repo { /* private fields */ }
Expand description
Structure properties.
Implementations§
Source§impl Repo
Repo functions.
impl Repo
Repo functions.
Sourcepub fn init<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn init<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Creates a new --bare
repository in the specified folder.
Sourcepub fn has_commits(&self) -> bool
pub fn has_commits(&self) -> bool
Returns true if repository has no commits.
Sourcepub fn has_branches(&self) -> bool
pub fn has_branches(&self) -> bool
Returns true if at least one branch exists.
Sourcepub fn has_branch(&self, name: &str) -> bool
pub fn has_branch(&self, name: &str) -> bool
Returns true if the provided branch exists.
Sourcepub fn switch_branch(&mut self, name: &str) -> Result<(), Error>
pub fn switch_branch(&mut self, name: &str) -> Result<(), Error>
Ensures new working branch. There must be at least one commit in the repository for this method to work other wise the error is thrown.
Sourcepub fn remove_branch(&mut self, name: &str) -> Result<(), Error>
pub fn remove_branch(&mut self, name: &str) -> Result<(), Error>
Removes working branch. Note that the current branch can not be removed and you have to first switch to a new branch.
Sourcepub fn insert_key(&mut self, name: &str, value: &[u8]) -> Result<(), Error>
pub fn insert_key(&mut self, name: &str, value: &[u8]) -> Result<(), Error>
Stages key for commit.
Sourcepub fn key_changed(&self, name: &str) -> bool
pub fn key_changed(&self, name: &str) -> bool
Returns true if the key content has been changed.
Auto Trait Implementations§
impl Freeze for Repo
impl RefUnwindSafe for Repo
impl Send for Repo
impl !Sync for Repo
impl Unpin for Repo
impl UnwindSafe for Repo
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