pub struct Repository { /* private fields */ }Implementations§
Source§impl Repository
impl Repository
Sourcepub fn new(host: &str, owner: &str, repo: &str) -> Self
pub fn new(host: &str, owner: &str, repo: &str) -> Self
Represent a git repository in one of the git hosting providers
Sourcepub fn from_url(url: &str) -> Result<Self, Box<dyn Error>>
pub fn from_url(url: &str) -> Result<Self, Box<dyn Error>>
Extracts the owner and repository name from a URL.
Returns Repository
Where host is either “github” or “gitlab” for now.
e.g. https://github.com/szabgab/rust-digger -> (“github”, “szabgab”, “rust-digger”)
pub fn url(&self) -> String
pub fn path(&self, root: &Path) -> PathBuf
pub fn owner_path(&self, root: &Path) -> PathBuf
pub fn get_owner(&self) -> &str
pub fn is_github(&self) -> bool
pub fn is_gitlab(&self) -> bool
pub fn is_bitbucket(&self) -> bool
pub fn has_github_actions(&self, root: &Path) -> bool
pub fn has_dependabot(&self, root: &Path) -> bool
pub fn has_gitlab_pipeline(&self, root: &Path) -> bool
pub fn has_bitbucket_pipeline(&self, root: &Path) -> bool
pub fn has_circle_ci(&self, root: &Path) -> bool
pub fn has_cirrus_ci(&self, root: &Path) -> bool
pub fn has_travis(&self, root: &Path) -> bool
pub fn has_jenkins(&self, root: &Path) -> bool
pub fn has_appveyor(&self, root: &Path) -> bool
Sourcepub fn update_repository(
&self,
root: &Path,
clone: bool,
depth: Option<usize>,
) -> Result<(), Box<dyn Error>>
pub fn update_repository( &self, root: &Path, clone: bool, depth: Option<usize>, ) -> Result<(), Box<dyn Error>>
Run git clone or git pull to update a single repository
pub fn check_url(&self) -> bool
Trait Implementations§
Source§impl Debug for Repository
impl Debug for Repository
Source§impl PartialEq for Repository
impl PartialEq for Repository
impl StructuralPartialEq for Repository
Auto Trait Implementations§
impl Freeze for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnwindSafe for Repository
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