Struct IssuesHandler

Source
pub struct IssuesHandler<'a> { /* private fields */ }
Expand description

A client for the Issue API.

See https://docs.github.com/en/rest/reference/issues.

Implementations§

Source§

impl<'a> IssuesHandler<'a>

Source

pub fn new( client: &'a Client, owner: impl Into<String>, repo: impl Into<String>, ) -> IssuesHandler<'_>

Source

pub fn list(&self) -> ListIssuesBuilder<'_>

List issues.

See https://docs.github.com/en/rest/reference/issues#list-repository-issues.

let client = ghrs::Client::new();
let issues = client.pulls("owner", "repo").list().per_page(100).send();
Examples found in repository?
examples/github_enterprise.rs (line 11)
3fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
4  let args: Vec<String> = std::env::args().collect();
5    let base_url = args.get(1).unwrap();
6    let token = args.get(2).unwrap();
7    let owner = args.get(3).unwrap();
8    let repo = args.get(4).unwrap();
9
10    let client = Client::new();
11    let mut current_page = client.base_url(base_url).token(token).issues(owner, repo).list().per_page(100).page(1).send()?;
12    let issues = current_page.take_items();
13
14    for issue in issues {
15      println!("{}", issue.title);
16    }
17
18    Ok(())
19}
Source

pub fn get(&self, issue_number: u64) -> GetIssueBuilder<'_>

Get an issue.

See hhttps://docs.github.com/en/rest/reference/issues#get-an-issue.

let client = ghrs::Client::new();
let issue = client.issues("owner", "repo").get(1234).send();

Auto Trait Implementations§

§

impl<'a> Freeze for IssuesHandler<'a>

§

impl<'a> RefUnwindSafe for IssuesHandler<'a>

§

impl<'a> Send for IssuesHandler<'a>

§

impl<'a> Sync for IssuesHandler<'a>

§

impl<'a> Unpin for IssuesHandler<'a>

§

impl<'a> UnwindSafe for IssuesHandler<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.