GitIndexerClient

Struct GitIndexerClient 

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

Client for interacting with a Helix DB instance.

Use GitIndexerClient::builder() to create a new client.

§Example

use git_indexer::GitIndexerClient;

let client = GitIndexerClient::builder()
    .endpoint("http://localhost:6969")
    .build()?;

let git_info = client.index_repository("/path/to/repo").await?;

Implementations§

Source§

impl GitIndexerClient

Source

pub fn builder() -> GitIndexerClientBuilder

Create a new builder for configuring a GitIndexerClient.

Source

pub fn endpoint(&self) -> &str

Get the configured endpoint URL.

Source

pub async fn index_repository<P: AsRef<Path>>( &self, repo_path: P, ) -> Result<GitInfo>

Index a git repository and push all data to Helix DB.

This is the main entry point for indexing a repository. It will:

  1. Extract all git information (branches, commits, file changes)
  2. Create nodes for each branch, commit, and file change
  3. Create edges for parent-child commit relationships
§Arguments
  • repo_path - Path to the git repository
§Returns

Returns the extracted GitInfo after successfully pushing to Helix DB.

Source

pub async fn create_commit_node(&self, commit: &CommitInfo) -> Result<()>

Create a commit node in Helix DB.

§Arguments
  • commit - The commit information to store
Source

pub async fn create_branch_node(&self, branch: &BranchInfo) -> Result<()>

Create a branch node in Helix DB.

§Arguments
  • branch - The branch information to store
Source

pub async fn create_file_node( &self, file: &FileChange, commit_id: &str, ) -> Result<()>

Create a file change node in Helix DB.

§Arguments
  • file - The file change information to store
  • commit_id - The SHA of the commit this file change belongs to
Source

pub async fn create_parent_edge( &self, child_id: &str, parent_id: &str, ) -> Result<()>

Create a parent-child edge between commits in Helix DB.

§Arguments
  • child_id - SHA of the child commit
  • parent_id - SHA of the parent commit

Trait Implementations§

Source§

impl Clone for GitIndexerClient

Source§

fn clone(&self) -> GitIndexerClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GitIndexerClient

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.