pub struct Library { /* private fields */ }Expand description
The Library struct manages a collection of projects in a specified directory.
Implementations§
Source§impl Library
impl Library
Sourcepub fn new(path: &Path, display_hidden: bool) -> Result<Self, LibraryError>
pub fn new(path: &Path, display_hidden: bool) -> Result<Self, LibraryError>
Makes a new Library instance.
Sourcepub fn collect_projects(
path: &Path,
display_hidden: bool,
) -> Result<IndexMap<String, PathBuf>, LibraryError>
pub fn collect_projects( path: &Path, display_hidden: bool, ) -> Result<IndexMap<String, PathBuf>, LibraryError>
Collects projects from the specified directory path.
Sourcepub fn clone(&self, options: &CloneOptions) -> Result<(), LibraryError>
pub fn clone(&self, options: &CloneOptions) -> Result<(), LibraryError>
Clones a Git repository into the library.
Sourcepub fn create(&mut self, name: &str) -> Result<(), LibraryError>
pub fn create(&mut self, name: &str) -> Result<(), LibraryError>
Creates a new project directory in the library.
Sourcepub fn delete(&mut self, name: &str) -> Result<(), LibraryError>
pub fn delete(&mut self, name: &str) -> Result<(), LibraryError>
Deletes a project directory from the library.
Sourcepub fn contains(&self, name: &str) -> bool
pub fn contains(&self, name: &str) -> bool
Checks if a project with the given name exists in the library.
Auto Trait Implementations§
impl Freeze for Library
impl RefUnwindSafe for Library
impl Send for Library
impl Sync for Library
impl Unpin for Library
impl UnsafeUnpin for Library
impl UnwindSafe for Library
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more