pub enum LinkStyle {
Github,
Gitlab,
Stash,
Cgit,
}Expand description
Determines the hyperlink style used in commit and issue links. Defaults to
LinksStyle::Github
§Example
let clog = Clog::new().unwrap();
clog.link_style(LinkStyle::Stash);Variants§
Implementations§
Source§impl LinkStyle
impl LinkStyle
Sourcepub fn issue_link<S: AsRef<str>>(&self, issue: S, repo: Option<S>) -> String
pub fn issue_link<S: AsRef<str>>(&self, issue: S, repo: Option<S>) -> String
Gets a hyperlink url to an issue in the specified format.
§Example
let link = LinkStyle::Github;
let issue = link.issue_link("141", Some("https://github.com/thoughtram/clog"));
assert_eq!("https://github.com/thoughtram/clog/issues/141", issue);Sourcepub fn commit_link<S: AsRef<str>>(&self, hash: S, repo: Option<S>) -> String
pub fn commit_link<S: AsRef<str>>(&self, hash: S, repo: Option<S>) -> String
Gets a hyperlink url to a commit in the specified format.
§Example
let link = LinkStyle::Github;
let commit = link.commit_link(
"123abc891234567890abcdefabc4567898724",
Some("https://github.com/clog-tool/clog-lib"),
);
assert_eq!(
"https://github.com/thoughtram/clog/commit/123abc891234567890abcdefabc4567898724",
commit
);Trait Implementations§
Source§impl<'de> Deserialize<'de> for LinkStyle
impl<'de> Deserialize<'de> for LinkStyle
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for LinkStyle
impl Eq for LinkStyle
impl StructuralPartialEq for LinkStyle
Auto Trait Implementations§
impl Freeze for LinkStyle
impl RefUnwindSafe for LinkStyle
impl Send for LinkStyle
impl Sync for LinkStyle
impl Unpin for LinkStyle
impl UnsafeUnpin for LinkStyle
impl UnwindSafe for LinkStyle
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
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.