[−][src]Struct octocrab::pulls::PullRequestHandler
A client to GitHub's pull request API.
Created with Octocrab::pulls
.
Implementations
impl<'octo> PullRequestHandler<'octo>
[src]
pub fn media_type(self, media_type: MediaType) -> Self
[src]
Set the media type for this request.
let pr = octocrab::instance() .pulls("owner", "repo") .media_type(octocrab::params::pulls::MediaType::Full) .get(404) .await?;
pub async fn is_merged<'_>(&'_ self, pr: u64) -> Result<bool>
[src]
Checks if a given pull request has been merged.
octocrab.pulls("owner", "repo").is_merged(101).await?;
pub async fn get<'_>(&'_ self, pr: u64) -> Result<PullRequest>
[src]
Get's a given pull request with by its pr
number.
let pr = octocrab::instance().pulls("owner", "repo").get(101).await?;
pub async fn get_diff<'_>(&'_ self, pr: u64) -> Result<String>
[src]
Get's a given pull request's diff
.
let diff = octocrab::instance().pulls("owner", "repo").get_diff(101).await?;
pub async fn get_patch<'_>(&'_ self, pr: u64) -> Result<String>
[src]
Get's a given pull request's patch.
let diff = octocrab::instance().pulls("owner", "repo").get_patch(101).await?;
pub fn create(
&self,
title: impl Into<String>,
head: impl Into<String>,
base: impl Into<String>
) -> CreatePullRequestBuilder<'octo, '_>
[src]
&self,
title: impl Into<String>,
head: impl Into<String>,
base: impl Into<String>
) -> CreatePullRequestBuilder<'octo, '_>
Create a new pull request.
title
— The title of the new pull request.head
— The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace head with a user like this:username:branch
.base
— The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository.
let pr = octocrab .pulls("owner", "repo") .create("title", "head", "base") .body("hello world!") .send() .await?;
pub fn list(&self) -> ListPullRequestsBuilder<'_, '_>
[src]
Creates a new ListPullRequestsBuilder
that can be configured to filter
listing pulling requests.
use octocrab::params; let page = octocrab.pulls("owner", "repo").list() // Optional Parameters .state(params::State::Open) .head("master") .base("branch") .sort(params::pulls::Sort::Popularity) .direction(params::Direction::Ascending) .per_page(100) .page(5u32) // Send the request .send() .await?;
Auto Trait Implementations
impl<'octo> !RefUnwindSafe for PullRequestHandler<'octo>
[src]
impl<'octo> Send for PullRequestHandler<'octo>
[src]
impl<'octo> Sync for PullRequestHandler<'octo>
[src]
impl<'octo> Unpin for PullRequestHandler<'octo>
[src]
impl<'octo> !UnwindSafe for PullRequestHandler<'octo>
[src]
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]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub 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>,