pub struct InMemoryRepo { /* private fields */ }
Implementations§
Source§impl InMemoryRepo
impl InMemoryRepo
pub fn new() -> Self
pub fn clear(&mut self)
pub fn gen_id(&mut self) -> Oid
pub fn push_commit(&mut self, parent_id: Option<Oid>, commit: Commit)
pub fn head_id(&mut self) -> Option<Oid>
pub fn set_head(&mut self, head_id: Oid)
pub fn mark_branch(&mut self, branch: Branch)
pub fn push_remote(&self) -> &str
pub fn pull_remote(&self) -> &str
pub fn is_dirty(&self) -> bool
pub fn merge_base(&self, one: Oid, two: Oid) -> Option<Oid>
pub fn find_commit(&self, id: Oid) -> Option<Rc<Commit>>
pub fn head_commit(&self) -> Rc<Commit>
pub fn head_branch(&self) -> Option<Branch>
pub fn resolve(&self, revspec: &str) -> Option<Rc<Commit>>
pub fn parent_ids(&self, head_id: Oid) -> Result<Vec<Oid>>
pub fn commit_count(&self, base_id: Oid, head_id: Oid) -> Option<usize>
pub fn commit_range( &self, base_bound: Bound<&Oid>, head_bound: Bound<&Oid>, ) -> Result<Vec<Oid>>
pub fn contains_commit(&self, haystack_id: Oid, needle_id: Oid) -> Result<bool>
pub fn cherry_pick(&mut self, head_id: Oid, cherry_id: Oid) -> Result<Oid>
pub fn reword(&mut self, head_id: Oid, msg: &str) -> Result<Oid>
pub fn squash(&mut self, head_id: Oid, into_id: Oid) -> Result<Oid>
pub fn stash_push(&mut self, _message: Option<&str>) -> Result<Oid>
pub fn stash_pop(&mut self, _stash_id: Oid) -> Result<()>
pub fn branch(&mut self, name: &str, id: Oid) -> Result<()>
pub fn delete_branch(&mut self, name: &str) -> Result<()>
pub fn find_local_branch(&self, name: &str) -> Option<Branch>
pub fn find_remote_branch(&self, _remote: &str, _name: &str) -> Option<Branch>
pub fn local_branches(&self) -> impl Iterator<Item = Branch> + '_
pub fn remote_branches(&self) -> impl Iterator<Item = Branch> + '_
pub fn detach(&mut self) -> Result<()>
pub fn switch_branch(&mut self, name: &str) -> Result<()>
pub fn switch_commit(&mut self, id: Oid) -> Result<()>
Trait Implementations§
Source§impl Debug for InMemoryRepo
impl Debug for InMemoryRepo
Source§impl Default for InMemoryRepo
impl Default for InMemoryRepo
Source§impl Repo for InMemoryRepo
impl Repo for InMemoryRepo
fn path(&self) -> Option<&Path>
fn user(&self) -> Option<Rc<str>>
fn push_remote(&self) -> &str
fn pull_remote(&self) -> &str
fn is_dirty(&self) -> bool
fn merge_base(&self, one: Oid, two: Oid) -> Option<Oid>
fn find_commit(&self, id: Oid) -> Option<Rc<Commit>>
fn head_commit(&self) -> Rc<Commit>
fn resolve(&self, revspec: &str) -> Option<Rc<Commit>>
fn parent_ids(&self, head_id: Oid) -> Result<Vec<Oid>>
fn commit_count(&self, base_id: Oid, head_id: Oid) -> Option<usize>
fn commit_range( &self, base_bound: Bound<&Oid>, head_bound: Bound<&Oid>, ) -> Result<Vec<Oid>>
fn contains_commit(&self, haystack_id: Oid, needle_id: Oid) -> Result<bool>
fn cherry_pick(&mut self, head_id: Oid, cherry_id: Oid) -> Result<Oid>
fn reword(&mut self, head_oid: Oid, msg: &str) -> Result<Oid>
fn squash(&mut self, head_id: Oid, into_id: Oid) -> Result<Oid>
fn head_branch(&self) -> Option<Branch>
fn stash_push(&mut self, message: Option<&str>) -> Result<Oid>
fn stash_pop(&mut self, stash_id: Oid) -> Result<()>
fn branch(&mut self, name: &str, id: Oid) -> Result<()>
fn delete_branch(&mut self, name: &str) -> Result<()>
fn find_local_branch(&self, name: &str) -> Option<Branch>
fn find_remote_branch(&self, remote: &str, name: &str) -> Option<Branch>
fn local_branches(&self) -> Box<dyn Iterator<Item = Branch> + '_>
fn remote_branches(&self) -> Box<dyn Iterator<Item = Branch> + '_>
fn detach(&mut self) -> Result<()>
fn switch_branch(&mut self, name: &str) -> Result<()>
fn switch_commit(&mut self, id: Oid) -> Result<()>
Auto Trait Implementations§
impl !Freeze for InMemoryRepo
impl RefUnwindSafe for InMemoryRepo
impl !Send for InMemoryRepo
impl !Sync for InMemoryRepo
impl Unpin for InMemoryRepo
impl UnwindSafe for InMemoryRepo
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more