Struct sit_core::repository::Repository
[−]
[src]
pub struct Repository { /* fields omitted */ }
Repository is the container for all SIT artifacts
Methods
impl Repository
[src]
pub fn new<P: Into<PathBuf>>(path: P) -> Result<Self, Error>
[src]
Attempts creating a new repository. Fails with Error::AlreadyExists
if a repository already exists.
pub fn new_with_config<P: Into<PathBuf>>(
path: P,
config: Config
) -> Result<Self, Error>
[src]
path: P,
config: Config
) -> Result<Self, Error>
Attempts creating a new repository with a specified config. Fails with Error::AlreadyExists
if a repository already exists.
pub fn open<P: Into<PathBuf>>(path: P) -> Result<Self, Error>
[src]
Opens an existing repository. Fails if there's no valid repository at the given path
pub fn open_and_upgrade<P: Into<PathBuf>, U: AsRef<[Upgrade]>>(
path: P,
upgrades: U
) -> Result<Self, Error>
[src]
path: P,
upgrades: U
) -> Result<Self, Error>
Opens and, if necessary, upgrades an existing repository. Allow to specify which particular upgrades should be allowed.
Fails if there's no valid repository at the given path.
pub fn find_in_or_above<P: Into<PathBuf>, S: AsRef<str>>(
dir: S,
path: P
) -> Option<PathBuf>
[src]
dir: S,
path: P
) -> Option<PathBuf>
Given relative path of path
(such as ".sit"), finds a repository in a directory or above
pub fn populate_default_files(&self) -> Result<(), Error>
[src]
Populates repository with default files
pub fn path(&self) -> &Path
[src]
Returns repository path
pub fn items_path(&self) -> &Path
[src]
Returns items path
pub fn config(&self) -> &Config
[src]
Returns repository's config
pub fn item_iter(&self) -> Result<ItemIter, Error>
[src]
Returns an unordered (as in "order not defined") item iterator
pub fn new_item(&self) -> Result<Item, Error>
[src]
Creates and returns a new item with a unique ID
pub fn new_named_item<S: Into<String>>(&self, name: S) -> Result<Item, Error>
[src]
Creates and returns a new item with a specific name. Will fail if there's an item with the same name.
pub fn modules_path(&self) -> &Path
[src]
Returns path to modules. The target directory may not exist.
pub fn module_iter(&self) -> Result<Box<Iterator<Item = PathBuf>>, Error>
[src]
Returns an iterator over the list of modules (directories under modules
directory)