pub struct PrRef {
pub url: String,
pub host: String,
pub owner: String,
pub repo: String,
pub number: u64,
}Expand description
A parsed reference to a GitHub pull request. The base repo is recorded
explicitly (owner/repo/host) rather than inferred from a checkout’s
origin, so a PR opened from a fork is still addressed against the repo
where the diff and its review comments live (DESIGN.md §11c).
Fields§
§url: StringCanonical https://{host}/{owner}/{repo}/pull/{number} URL.
host: String§owner: String§repo: String§number: u64Implementations§
Source§impl PrRef
impl PrRef
Sourcepub fn parse(input: &str) -> Result<PrRef>
pub fn parse(input: &str) -> Result<PrRef>
Parse a PR reference from a URL (https://github.com/o/r/pull/12, with
or without scheme, extra path segments, or a query/fragment) or the
owner/repo#number shorthand. Enterprise hosts are preserved. The URL
is re-emitted in canonical form so tracking is idempotent regardless of
which form the operator pasted.
Sourcepub fn api_path(&self, resource: &str) -> String
pub fn api_path(&self, resource: &str) -> String
The API path segment for this PR’s REST resources, e.g.
repos/owner/repo/pulls/12.
Sourcepub fn range_url(&self, since: &str, head: &str) -> String
pub fn range_url(&self, since: &str, head: &str) -> String
The PR’s diff narrowed to a commit range — GitHub’s compare-within-a-PR view (DESIGN.md §8), which is what makes a re-review proportional to the rework rather than to the whole branch. It stays inside the PR, so the review comments and the merge button are where they always were, and the full diff remains one click away.
Trait Implementations§
impl Eq for PrRef
impl StructuralPartialEq for PrRef
Auto Trait Implementations§
impl Freeze for PrRef
impl RefUnwindSafe for PrRef
impl Send for PrRef
impl Sync for PrRef
impl Unpin for PrRef
impl UnsafeUnpin for PrRef
impl UnwindSafe for PrRef
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.