pub struct Commit<'a> {
pub body: Option<&'a str>,
pub desc: &'a str,
pub footer: Vec<Footer<'a>>,
pub is_breaking_change: bool,
pub scope: Option<&'a str>,
pub ty: &'a str,
}
Expand description
A commit message.
As per the specification, a commit message is made out of a mandatory
description, an optional body and 0..n
optional footers. The different
sections are separated by an empty newline. Footers can be each separated
with a newline, however, this is not needed.
§Example
feat(some scope): a short and concise description
This is a longer body message. It can wrapped around
and be put onto multiple lines.
This is still part of the body.
Fixes #123
PR-close #124
Signed-off-by: SirWindfield
Fields§
§body: Option<&'a str>
The optional body.
desc: &'a str
The mandatory description.
A list of footers. Empty when none are part of the commit message.
is_breaking_change: bool
Set if the commit is a breaking change.
scope: Option<&'a str>
The optional scope.
ty: &'a str
The mandatory type.
Types other than feat
and fix
are optional. For more information, please take a look at the specification, paragraphs 1-3.
Implementations§
Trait Implementations§
impl<'a> Eq for Commit<'a>
impl<'a> StructuralPartialEq for Commit<'a>
Auto Trait Implementations§
impl<'a> Freeze for Commit<'a>
impl<'a> RefUnwindSafe for Commit<'a>
impl<'a> Send for Commit<'a>
impl<'a> Sync for Commit<'a>
impl<'a> Unpin for Commit<'a>
impl<'a> UnwindSafe for Commit<'a>
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