GitPlumber

Struct GitPlumber 

Source
pub struct GitPlumber { /* private fields */ }
Expand description

Main application struct that handles shared logic

Implementations§

Source§

impl GitPlumber

Source

pub fn new(repo_path: impl AsRef<Path>) -> Self

Create a new GitPlumber instance

Source

pub fn get_repo_path(&self) -> &Path

Get the repository path

Source

pub const fn get_repository(&self) -> Option<&Repository>

Get access to the repository if it exists

Source

pub fn list_pack_files(&self) -> Result<Vec<PathBuf>, RepositoryError>

List all pack files in the repository

§Errors

This function will return an error if:

  • The path is not a valid git repository
  • File system operations fail when reading the objects/pack directory
Source

pub fn list_pack_groups( &self, ) -> Result<HashMap<String, PackGroup>, RepositoryError>

List all pack-related files grouped by their base name

§Errors

This function will return an error if:

  • The path is not a valid git repository
  • File system operations fail when reading the objects/pack directory
Source

pub fn list_head_refs(&self) -> Result<Vec<PathBuf>, RepositoryError>

List all head refs (local branches) in the repository

§Errors

This function will return an error if:

  • The path is not a valid git repository
  • File system operations fail when reading the refs/heads directory
Source

pub fn list_remote_refs( &self, ) -> Result<Vec<(String, Vec<PathBuf>)>, RepositoryError>

List all remote refs in the repository

§Errors

This function will return an error if:

  • The path is not a valid git repository
  • File system operations fail when reading the refs/remotes directory
Source

pub fn list_tag_refs(&self) -> Result<Vec<PathBuf>, RepositoryError>

List all tag refs in the repository

§Errors

This function will return an error if:

  • The path is not a valid git repository
  • File system operations fail when reading the refs/tags directory
Source

pub fn has_stash_ref(&self) -> Result<bool, RepositoryError>

Check if the repository has stash refs

§Errors

This function will return an error if:

  • The path is not a valid git repository
  • File system operations fail when checking for stash refs
Source

pub fn list_loose_objects( &self, limit: usize, ) -> Result<Vec<PathBuf>, RepositoryError>

List loose objects in the repository with a limit

§Errors

This function will return an error if:

  • The path is not a valid git repository
  • File system operations fail when reading loose object directories
Source

pub fn list_parsed_loose_objects( &self, limit: usize, ) -> Result<Vec<LooseObject>, RepositoryError>

List parsed loose objects in the repository with a limit

§Errors

This function will return an error if:

  • The path is not a valid git repository
  • File system operations fail when reading loose object directories
  • Loose objects cannot be parsed or decompressed
Source

pub fn get_loose_object_stats( &self, ) -> Result<LooseObjectStats, RepositoryError>

Get statistics about loose objects in the repository

§Errors

This function will return an error if:

  • The path is not a valid git repository
  • File system operations fail when reading loose object directories
  • Loose objects cannot be parsed or analyzed
Source

pub fn parse_pack_file(&self, path: &Path) -> Result<(), String>

Parse a pack file (basic analysis)

§Errors

This function will return an error if:

  • The pack file cannot be read
  • The pack file format is invalid
  • Parsing operations fail
Source

pub fn parse_pack_file_rich(&self, path: &Path) -> Result<(), String>

Parse a pack file with detailed formatting for display

§Errors

This function will return an error if:

  • The pack file cannot be read
  • The pack file format is invalid
  • Parsing or display formatting operations fail
Source

pub fn view_file_as_object(&self, path: &Path) -> Result<(), String>

View a file as a loose object with rich formatting

§Errors

This function will return an error if:

  • The file cannot be read or parsed as a loose object
  • The formatting operations fail
Source

pub fn view_object_by_hash(&self, hash: &str) -> Result<(), String>

View an object by hash with rich formatting

§Errors

This function will return an error if:

  • The object cannot be found by hash
  • Multiple objects match a partial hash (disambiguation needed)
  • The formatting operations fail

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

Source§

type Output = T

Should always be Self
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.