Skip to main content

Repo

Struct Repo 

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

a zub repository

Implementations§

Source§

impl Repo

Source

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

initialize a new repository at the given path

Source

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

open an existing repository

Source

pub fn path(&self) -> &Path

repository root path

Source

pub fn config(&self) -> &Config

repository configuration

Source

pub fn config_mut(&mut self) -> &mut Config

mutable access to configuration

Source

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

save configuration changes

Source

pub fn config_path(&self) -> PathBuf

path to config.toml

Source

pub fn objects_path(&self) -> PathBuf

path to objects directory

Source

pub fn blobs_path(&self) -> PathBuf

path to blobs directory

Source

pub fn trees_path(&self) -> PathBuf

path to trees directory

Source

pub fn commits_path(&self) -> PathBuf

path to commits directory

Source

pub fn refs_path(&self) -> PathBuf

path to refs directory

Source

pub fn tags_path(&self) -> PathBuf

path to tags directory

Source

pub fn tmp_path(&self) -> PathBuf

path to tmp directory (for atomic writes)

Source

pub fn lock_path(&self) -> PathBuf

path to lock file

Source

pub fn lock(&self) -> Result<RepoLock>

acquire exclusive lock on repository returns a guard that releases the lock on drop

Source

pub fn try_lock(&self) -> Result<Option<RepoLock>>

try to acquire exclusive lock, returning None if already locked

Auto Trait Implementations§

§

impl Freeze for Repo

§

impl RefUnwindSafe for Repo

§

impl Send for Repo

§

impl Sync for Repo

§

impl Unpin for Repo

§

impl UnsafeUnpin for Repo

§

impl UnwindSafe for Repo

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.