Struct github_issue_url::Issue [−][src]
pub struct Issue<'a> { /* fields omitted */ }
Expand description
GitHub issue struct with support for every field available.
This struct is holds repository, username or organization name and fields to prefill when opening the issue url.
Example
use github_issue_url::Issue; const GITHUB_ISSUE_LINK: &str = "https://github.com/EstebanBorai/github-issue-url/issues/new?title=Null%3A+The+Billion+Dollar+Mistake&body=Null+is+a+flag.+It+represents+different+situations+depending+on+the+context+in+which+it+is+used+and+invoked.+This+yields+the+most+serious+error+in+software+development%3A+Coupling+a+hidden+decision+in+the+contract+between+an+object+and+who+uses+it.&template=bug_report.md&labels=bug%2Cproduction%2Chigh-severity&assignee=EstebanBorai&milestone=1&projects=1"; const SAMPLE_ISSUE_BODY: &str = r#"Null is a flag. It represents different situations depending on the context in which it is used and invoked. This yields the most serious error in software development: Coupling a hidden decision in the contract between an object and who uses it."#; let mut have = Issue::new("github-issue-url", "EstebanBorai").unwrap(); have.title("Null: The Billion Dollar Mistake"); have.body(SAMPLE_ISSUE_BODY); have.template("bug_report.md"); have.labels("bug,production,high-severity"); have.assignee("EstebanBorai"); have.milestone("1"); have.projects("1"); let have = have.url().unwrap(); assert_eq!(have, GITHUB_ISSUE_LINK.to_string());
Implementations
impl<'a> Issue<'a>
[src]
impl<'a> Issue<'a>
[src]GitHub Issue including the repository name and the repository owner username.
Issue fields are kept in a Vec<(&'a str, &'a str)>
for easy parsing when
parsing the URL with query params.
Every optional param is specified using the setter methods.
pub fn new(repository_name: &'a str, repository_owner: &'a str) -> Result<Self>
[src]
pub fn assignee(&mut self, assignee: &'a str)
[src]
pub fn assignee(&mut self, assignee: &'a str)
[src]The username of the issue’s assignee.
The issue author requires write access to the repository in order to use this feature
pub fn labels(&mut self, labels: &'a str)
[src]
pub fn labels(&mut self, labels: &'a str)
[src]Issue labels separated by comma (,
).
Example: bug,production,high-severity
The issue author requires write access to the repository in order to use this feature
pub fn milestone(&mut self, milestone: &'a str)
[src]
pub fn milestone(&mut self, milestone: &'a str)
[src]The ID (number) of the milestone linked to this issue.
The milestone ID can be found in the Issues/Milestone section.
https://github.com/
The issue author requires write access to the repository in order to use this feature
pub fn projects(&mut self, projects: &'a str)
[src]
pub fn projects(&mut self, projects: &'a str)
[src]The IDs (number) of the projects to link this issue to separated by
comma (,
).
Projects IDs are found in the repository session.
https://github.com/
The issue author requires write access to the repository in order to use this feature
pub fn template(&mut self, template: &'a str)
[src]
pub fn template(&mut self, template: &'a str)
[src]The name of the issue template to use when opening the final link.
An issue template lives in .github/ISSUE_TEMPLATE/Issue.template
must be bugs.md