pub struct GithubRef { /* private fields */ }Expand description
A GitHub repository, optionally at a tag. The fields are private: only
GithubRef::parse makes one from outside this module, so the owner,
repository and tag always passed its checks before they are joined onto
an API path (#649 review).
Implementations§
Source§impl GithubRef
impl GithubRef
Sourcepub fn parse(input: &str) -> Option<Self>
pub fn parse(input: &str) -> Option<Self>
Parse https://github.com/{owner}/{repo}, optionally followed by
/releases/tag/{tag} or /tree/{tag}. None for anything else,
including other hosts and non-repository GitHub pages.
Sourcepub fn html_url(&self) -> String
pub fn html_url(&self) -> String
The page a reader follows: the release when there is a tag, else the repository.
Sourcepub fn default_key(&self) -> String
pub fn default_key(&self) -> String
A citation key when no template or --key gives one:
{repo}_{tag} reduced to what every BibTeX processor accepts.
Trait Implementations§
impl Eq for GithubRef
impl StructuralPartialEq for GithubRef
Auto Trait Implementations§
impl Freeze for GithubRef
impl RefUnwindSafe for GithubRef
impl Send for GithubRef
impl Sync for GithubRef
impl Unpin for GithubRef
impl UnsafeUnpin for GithubRef
impl UnwindSafe for GithubRef
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