Repository

Struct Repository 

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

A Heroforge repository handle.

This is the main entry point for interacting with Heroforge repositories. It provides a fluent builder API for all operations.

§Opening Repositories

§Builder API

Implementations§

Source§

impl Repository

Source

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>

Open a repository in read-only mode.

Source

pub fn open_rw<P: AsRef<Path>>(path: P) -> Result<Self>

Open a repository in read-write mode.

Source

pub fn init<P: AsRef<Path>>(path: P) -> Result<Self>

Create a new repository.

Source

pub fn files(&self) -> FilesBuilder<'_>

Access file operations.

Source

pub fn commit_builder(&self) -> CommitBuilder<'_>

Start building a commit using the builder pattern.

Source

pub fn branches(&self) -> BranchesBuilder<'_>

Access branch operations.

Source

pub fn tags(&self) -> TagsBuilder<'_>

Access tag operations.

Source

pub fn history(&self) -> HistoryBuilder<'_>

Access history/commit browsing.

Source

pub fn users(&self) -> UsersBuilder<'_>

Access user operations.

Source

pub fn sync(&self) -> SyncBuilder<'_>

Access sync operations.

Source

pub fn fs(&self) -> FsOpsBuilder<'_>

Access filesystem operations (copy, move, delete, chmod, find, symlinks).

Source

pub fn project_code(&self) -> Result<String>

Get the project code.

Source

pub fn project_name(&self) -> Result<Option<String>>

Get the project name.

Source

pub fn database(&self) -> &Database

Get the underlying database handle.

Source

pub fn rebuild(&self) -> Result<()>

Rebuild repository metadata.

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.