Struct git_conventional::Commit
source · pub struct Commit<'a> { /* private fields */ }
Expand description
A conventional commit.
Implementations§
source§impl<'a> Commit<'a>
impl<'a> Commit<'a>
sourcepub fn parse(string: &'a str) -> Result<Self, Error>
pub fn parse(string: &'a str) -> Result<Self, Error>
Create a new Conventional Commit based on the provided commit message string.
§Errors
This function returns an error if the commit does not conform to the Conventional Commit specification.
sourcepub fn description(&self) -> &'a str
pub fn description(&self) -> &'a str
The commit description.
sourcepub fn body(&self) -> Option<&'a str>
pub fn body(&self) -> Option<&'a str>
The commit body, containing a more detailed explanation of the commit changes.
sourcepub fn breaking(&self) -> bool
pub fn breaking(&self) -> bool
A flag to signal that the commit contains breaking changes.
This flag is set either when the commit has an exclamation mark after the message type and scope, e.g.:
feat(scope)!: this is a breaking change
Or when the BREAKING CHANGE:
footer is defined:
feat: my commit description
BREAKING CHANGE: this is a breaking change
sourcepub fn breaking_description(&self) -> Option<&'a str>
pub fn breaking_description(&self) -> Option<&'a str>
Explanation for the breaking change.
Note: if no BREAKING CHANGE
footer is provided, the description
is expected to describe
the breaking change.
Any footer.
A footer is similar to a Git trailer, with the exception of not requiring whitespace before newlines.
Trait Implementations§
source§impl<'a> PartialEq for Commit<'a>
impl<'a> PartialEq for Commit<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)