[−][src]Struct sit_core::repository::Repository
Repository is the container for all SIT artifacts
Methods
impl Repository
[src]
impl Repository
pub fn new<P: Into<PathBuf>>(path: P) -> Result<Self, Error>
[src]
pub fn new<P: Into<PathBuf>>(path: P) -> Result<Self, Error>
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]
pub fn new_with_config<P: Into<PathBuf>>(
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]
pub fn open<P: Into<PathBuf>>(path: P) -> Result<Self, Error>
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]
pub fn open_and_upgrade<P: Into<PathBuf>, U: AsRef<[Upgrade]>>(
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]
pub fn find_in_or_above<P: Into<PathBuf>, S: AsRef<str>>(
dir: S,
path: P
) -> Option<PathBuf>
Given relative path of path
(such as ".sit"), finds a repository in a directory or above
impl Repository
[src]
impl Repository
pub fn populate_default_files(&self) -> Result<(), Error>
[src]
pub fn populate_default_files(&self) -> Result<(), Error>
Populates repository with default files
pub fn items_path(&self) -> &Path
[src]
pub fn items_path(&self) -> &Path
Returns items path
pub fn config(&self) -> &Config
[src]
pub fn config(&self) -> &Config
Returns repository's config
pub fn item_iter(&self) -> Result<ItemIter, Error>
[src]
pub fn item_iter(&self) -> Result<ItemIter, Error>
Returns an unordered (as in "order not defined") item iterator
pub fn new_item(&self) -> Result<Item, Error>
[src]
pub fn new_item(&self) -> Result<Item, Error>
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]
pub fn new_named_item<S: Into<String>>(&self, name: S) -> Result<Item, Error>
Creates and returns a new item with a specific name. Will fail if there's an item with the same name.
pub fn item<S: AsRef<str>>(&self, name: S) -> Option<Item>
[src]
pub fn item<S: AsRef<str>>(&self, name: S) -> Option<Item>
Finds an item by name (if there is one)
pub fn modules_path(&self) -> &Path
[src]
pub fn modules_path(&self) -> &Path
Returns path to modules. The target directory may not exist.
pub fn module_iter(&self) -> Result<Box<dyn Iterator<Item = PathBuf>>, Error>
[src]
pub fn module_iter(&self) -> Result<Box<dyn Iterator<Item = PathBuf>>, Error>
Returns an iterator over the list of modules (directories under modules
directory)
Trait Implementations
impl HasPath for Repository
[src]
impl HasPath for Repository
impl PartialEq<Repository> for Repository
[src]
impl PartialEq<Repository> for Repository
fn eq(&self, rhs: &Repository) -> bool
[src]
fn eq(&self, rhs: &Repository) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Debug for Repository
[src]
impl Debug for Repository
Auto Trait Implementations
impl Send for Repository
impl Send for Repository
impl Sync for Repository
impl Sync for Repository
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self