pub struct RepoCommands { /* private fields */ }
Expand description
Repository commands namespace
Implementations§
Source§impl RepoCommands
impl RepoCommands
Sourcepub fn clone(&self, repo: &str) -> RepoCloneCommand
pub fn clone(&self, repo: &str) -> RepoCloneCommand
Sourcepub fn create(&self, name: &str) -> RepoCreateCommand
pub fn create(&self, name: &str) -> RepoCreateCommand
Create a new repository
Examples found in repository?
examples/repo.rs (line 8)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GhClient::new();
5 println!("Creating a new repository:");
6 match client
7 .repo()
8 .create("gh-cli-rs")
9 .description("A wrapper for GitHub CLI in Rust")
10 .public()
11 .with_readme()
12 .execute()
13 {
14 Ok(result) => println!("✓ Repository created: {}", result),
15 Err(e) => eprintln!("✗ Error: {}", e),
16 }
17
18 Ok(())
19}
Sourcepub fn fork(&self, repo: &str) -> RepoForkCommand
pub fn fork(&self, repo: &str) -> RepoForkCommand
Fork a repository
Sourcepub fn list(&self) -> RepoListCommand
pub fn list(&self) -> RepoListCommand
List repositories
Examples found in repository?
examples/basic_usage.rs (line 11)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GhClient::new();
5
6 // Check if gh CLI is installed
7 let version = client.check_installation()?;
8 println!("✓ GitHub CLI: {}", version.trim());
9
10 // List repositories
11 let repos = client.repo().list().limit(5).execute()?;
12 println!("{}", repos);
13
14 Ok(())
15}
Sourcepub fn view(&self, repo: Option<&str>) -> RepoViewCommand
pub fn view(&self, repo: Option<&str>) -> RepoViewCommand
View repository details
Trait Implementations§
Source§impl Clone for RepoCommands
impl Clone for RepoCommands
Source§fn clone(&self) -> RepoCommands
fn clone(&self) -> RepoCommands
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for RepoCommands
impl RefUnwindSafe for RepoCommands
impl Send for RepoCommands
impl Sync for RepoCommands
impl Unpin for RepoCommands
impl UnwindSafe for RepoCommands
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