Struct InMemoryRepo

Source
pub struct InMemoryRepo { /* private fields */ }

Implementations§

Source§

impl InMemoryRepo

Source

pub fn new() -> Self

Source

pub fn clear(&mut self)

Source

pub fn gen_id(&mut self) -> Oid

Source

pub fn push_commit(&mut self, parent_id: Option<Oid>, commit: Commit)

Source

pub fn head_id(&mut self) -> Option<Oid>

Source

pub fn set_head(&mut self, head_id: Oid)

Source

pub fn mark_branch(&mut self, branch: Branch)

Source

pub fn push_remote(&self) -> &str

Source

pub fn pull_remote(&self) -> &str

Source

pub fn is_dirty(&self) -> bool

Source

pub fn merge_base(&self, one: Oid, two: Oid) -> Option<Oid>

Source

pub fn find_commit(&self, id: Oid) -> Option<Rc<Commit>>

Source

pub fn head_commit(&self) -> Rc<Commit>

Source

pub fn head_branch(&self) -> Option<Branch>

Source

pub fn resolve(&self, revspec: &str) -> Option<Rc<Commit>>

Source

pub fn parent_ids(&self, head_id: Oid) -> Result<Vec<Oid>>

Source

pub fn commit_count(&self, base_id: Oid, head_id: Oid) -> Option<usize>

Source

pub fn commit_range( &self, base_bound: Bound<&Oid>, head_bound: Bound<&Oid>, ) -> Result<Vec<Oid>>

Source

pub fn contains_commit(&self, haystack_id: Oid, needle_id: Oid) -> Result<bool>

Source

pub fn cherry_pick(&mut self, head_id: Oid, cherry_id: Oid) -> Result<Oid>

Source

pub fn reword(&mut self, head_id: Oid, msg: &str) -> Result<Oid>

Source

pub fn squash(&mut self, head_id: Oid, into_id: Oid) -> Result<Oid>

Source

pub fn stash_push(&mut self, _message: Option<&str>) -> Result<Oid>

Source

pub fn stash_pop(&mut self, _stash_id: Oid) -> Result<()>

Source

pub fn branch(&mut self, name: &str, id: Oid) -> Result<()>

Source

pub fn delete_branch(&mut self, name: &str) -> Result<()>

Source

pub fn find_local_branch(&self, name: &str) -> Option<Branch>

Source

pub fn find_remote_branch(&self, _remote: &str, _name: &str) -> Option<Branch>

Source

pub fn local_branches(&self) -> impl Iterator<Item = Branch> + '_

Source

pub fn remote_branches(&self) -> impl Iterator<Item = Branch> + '_

Source

pub fn detach(&mut self) -> Result<()>

Source

pub fn switch_branch(&mut self, name: &str) -> Result<()>

Source

pub fn switch_commit(&mut self, id: Oid) -> Result<()>

Trait Implementations§

Source§

impl Debug for InMemoryRepo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InMemoryRepo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Repo for InMemoryRepo

Source§

fn path(&self) -> Option<&Path>

Source§

fn user(&self) -> Option<Rc<str>>

Source§

fn push_remote(&self) -> &str

Source§

fn pull_remote(&self) -> &str

Source§

fn is_dirty(&self) -> bool

Source§

fn merge_base(&self, one: Oid, two: Oid) -> Option<Oid>

Source§

fn find_commit(&self, id: Oid) -> Option<Rc<Commit>>

Source§

fn head_commit(&self) -> Rc<Commit>

Source§

fn resolve(&self, revspec: &str) -> Option<Rc<Commit>>

Source§

fn parent_ids(&self, head_id: Oid) -> Result<Vec<Oid>>

Source§

fn commit_count(&self, base_id: Oid, head_id: Oid) -> Option<usize>

Source§

fn commit_range( &self, base_bound: Bound<&Oid>, head_bound: Bound<&Oid>, ) -> Result<Vec<Oid>>

Source§

fn contains_commit(&self, haystack_id: Oid, needle_id: Oid) -> Result<bool>

Source§

fn cherry_pick(&mut self, head_id: Oid, cherry_id: Oid) -> Result<Oid>

Source§

fn reword(&mut self, head_oid: Oid, msg: &str) -> Result<Oid>

Source§

fn squash(&mut self, head_id: Oid, into_id: Oid) -> Result<Oid>

Source§

fn head_branch(&self) -> Option<Branch>

Source§

fn stash_push(&mut self, message: Option<&str>) -> Result<Oid>

Source§

fn stash_pop(&mut self, stash_id: Oid) -> Result<()>

Source§

fn branch(&mut self, name: &str, id: Oid) -> Result<()>

Source§

fn delete_branch(&mut self, name: &str) -> Result<()>

Source§

fn find_local_branch(&self, name: &str) -> Option<Branch>

Source§

fn find_remote_branch(&self, remote: &str, name: &str) -> Option<Branch>

Source§

fn local_branches(&self) -> Box<dyn Iterator<Item = Branch> + '_>

Source§

fn remote_branches(&self) -> Box<dyn Iterator<Item = Branch> + '_>

Source§

fn detach(&mut self) -> Result<()>

Source§

fn switch_branch(&mut self, name: &str) -> Result<()>

Source§

fn switch_commit(&mut self, id: Oid) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T