pub struct Repo<F: FileSystem> { /* private fields */ }Expand description
A handle to a Git repository
It is generic over the implementation of filesystem operations.
Implementations§
Source§impl<F: FileSystem> Repo<F>
impl<F: FileSystem> Repo<F>
Sourcepub async fn open(git_dir: F::Directory) -> GResult<Self>
pub async fn open(git_dir: F::Directory) -> GResult<Self>
Open the repository located at git_dir using a default RepoConfig.
Sourcepub async fn ref_names(&self) -> GResult<BTreeSet<RefName>>
pub async fn ref_names(&self) -> GResult<BTreeSet<RefName>>
Collect all the refs tracked by the repository
Includes HEAD, branches, tags, remotes and the stash
Sourcepub async fn lookup_ref(&self, name: &RefName) -> GResult<Ref>
pub async fn lookup_ref(&self, name: &RefName) -> GResult<Ref>
Take a ref name and look up its content.
Sourcepub async fn lookup_object(&self, id: ObjectId) -> GResult<Object>
pub async fn lookup_object(&self, id: ObjectId) -> GResult<Object>
Look up a particular object in the repository, reading the entire object into memory.
Sourcepub async fn lookup_object_size_type(
&self,
id: ObjectId,
) -> GResult<(ObjectSize, ObjectType)>
pub async fn lookup_object_size_type( &self, id: ObjectId, ) -> GResult<(ObjectSize, ObjectType)>
Look up the size and type of an object, without reading it to memory or parsing its content.
Auto Trait Implementations§
impl<F> Freeze for Repo<F>
impl<F> RefUnwindSafe for Repo<F>
impl<F> Send for Repo<F>
impl<F> Sync for Repo<F>
impl<F> Unpin for Repo<F>
impl<F> UnsafeUnpin for Repo<F>
impl<F> UnwindSafe for Repo<F>
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