pub struct GithubSpec {
pub owner: CompactString,
pub repo: CompactString,
pub ref_name: CompactString,
pub subdir: CompactString,
}Expand description
A parsed GitHub repository reference: {owner, repo, ref, subdir}.
Two spellings normalize here, so every consumer shares one parser:
- the URL form:
https://github.com/owner/repo[/tree/ref[/subdir…]](e.g.https://github.com/example-org/docs-site/tree/main/stacks); - the ref grammar:
github:owner/repo@ref[//subdir].
A bare repo (no ref) leaves GithubSpec::ref_name empty; the source
resolves it to the repository’s default branch with one extra API call.
Known limitation of the URL form: GitHub’s own URLs cannot distinguish a
branch name containing / from the start of a path, so the first segment
after /tree/ is taken as the ref. Branches like feat/x need the ref
grammar, where @ref//subdir is unambiguous.
Fields§
§owner: CompactStringRepository owner (user or organization).
repo: CompactStringRepository name.
ref_name: CompactStringBranch, tag, or commit SHA; empty = the repository’s default branch.
subdir: CompactStringSubdirectory to index (“” = the whole repository).
Implementations§
Trait Implementations§
Source§impl Clone for GithubSpec
impl Clone for GithubSpec
Source§impl Debug for GithubSpec
impl Debug for GithubSpec
impl Eq for GithubSpec
Source§impl PartialEq for GithubSpec
impl PartialEq for GithubSpec
impl StructuralPartialEq for GithubSpec
Auto Trait Implementations§
impl Freeze for GithubSpec
impl RefUnwindSafe for GithubSpec
impl Send for GithubSpec
impl Sync for GithubSpec
impl Unpin for GithubSpec
impl UnsafeUnpin for GithubSpec
impl UnwindSafe for GithubSpec
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more