[−][src]Struct octocrab::repos::RepoHandler
Handler for GitHub's repository API.
Created with Octocrab::repos
.
Implementations
impl<'octo> RepoHandler<'octo>
[src]
pub async fn license<'_>(&'_ self) -> Result<Content>
[src]
Get's a repository's license.
let license = octocrab::instance().repos("owner", "repo").license().await?;
pub async fn get_ref<'_, '_>(&'_ self, reference: &'_ Reference) -> Result<Ref>
[src]
Fetches a single reference in the Git database.
use octocrab::params::repos::Reference; let master = octocrab::instance() .repos("owner", "repo") .get_ref(&Reference::Branch("master".to_string())) .await?;
pub async fn create_ref<'_, '_>(
&'_ self,
reference: &'_ Reference,
sha: impl Into<String>
) -> Result<Ref>
[src]
&'_ self,
reference: &'_ Reference,
sha: impl Into<String>
) -> Result<Ref>
Creates a new reference for the repository.
use octocrab::params::repos::Reference; // Given the SHA of the master branch, creates a 1.0 tag (🎉) octocrab::instance() .repos("owner", "repo") .create_ref(&Reference::Tag("1.0".to_string()), master_sha) .await?;
pub fn create_file(
&self,
path: impl Into<String>,
message: impl Into<String>,
content: impl AsRef<[u8]>
) -> UpdateFileBuilder<'_, '_>
[src]
&self,
path: impl Into<String>,
message: impl Into<String>,
content: impl AsRef<[u8]>
) -> UpdateFileBuilder<'_, '_>
Creates a new file in the repository.
use octocrab::models::repos::GitUser; // Commit to add "crabs/ferris.txt" octocrab::instance() .repos("owner", "repo") .create_file( "crabs/ferris.txt", "Created ferris.txt", "Thought there’d never be a Rust Rap?\n" ) .branch("master") .commiter(GitUser { name: "Octocat".to_string(), email: "octocat@github.com".to_string(), }) .author(GitUser { name: "Ferris".to_string(), email: "ferris@rust-lang.org".to_string(), }) .send() .await?;
pub fn update_file(
&self,
path: impl Into<String>,
message: impl Into<String>,
content: impl AsRef<[u8]>,
sha: impl Into<String>
) -> UpdateFileBuilder<'_, '_>
[src]
&self,
path: impl Into<String>,
message: impl Into<String>,
content: impl AsRef<[u8]>,
sha: impl Into<String>
) -> UpdateFileBuilder<'_, '_>
use octocrab::models::repos::GitUser; // Given the file blob for "crabs/ferris.txt", commit to update the file. octocrab::instance() .repos("owner", "repo") .update_file( "crabs/ferris.txt", "Updated ferris.txt", "But me and Ferris Crab: best friends to the end.\n", blob_sha ) .branch("master") .commiter(GitUser { name: "Octocat".to_string(), email: "octocat@github.com".to_string(), }) .author(GitUser { name: "Ferris".to_string(), email: "ferris@rust-lang.org".to_string(), }) .send() .await?;
pub fn list_tags(&self) -> ListTagsBuilder<'_, '_>
[src]
List tags from a repository.
let tags = octocrab::instance().repos("owner", "repo").list_tags().send().await?;
pub fn releases(&self) -> ReleasesHandler<'_, '_>
[src]
Creates a ReleasesHandler
for the specified repository.
Auto Trait Implementations
impl<'octo> !RefUnwindSafe for RepoHandler<'octo>
impl<'octo> Send for RepoHandler<'octo>
impl<'octo> Sync for RepoHandler<'octo>
impl<'octo> Unpin for RepoHandler<'octo>
impl<'octo> !UnwindSafe for RepoHandler<'octo>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,