[−][src]Struct git_conventional::Commit
A conventional commit.
Methods
impl<'a> Commit<'a>
[src][−]
pub fn parse(string: &'a str) -> Result<Self, Error>
[src][−]
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.
pub fn type_(&self) -> Type<'a>
[src][−]
The type of the commit.
pub fn scope(&self) -> Option<Scope<'a>>
[src][−]
The optional scope of the commit.
pub fn description(&self) -> &'a str
[src][−]
The commit description.
pub fn body(&self) -> Option<&'a str>
[src][−]
The commit body, containing a more detailed explanation of the commit changes.
pub fn breaking(&self) -> bool
[src][−]
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 feat!: this is a breaking change
Or when the BREAKING CHANGE:
footer is defined:
feat: my commit description
BREAKING CHANGE: this is a breaking change
pub fn footers(&self) -> &[Footer]
[src][−]
Any footer.
A footer is similar to a Git trailer, with the exception of not requiring whitespace before newlines.
Trait Implementations
impl<'a> Clone for Commit<'a>
[src][+]
impl<'a> Debug for Commit<'a>
[src][+]
impl<'_> Display for Commit<'_>
[src][+]
Auto Trait Implementations
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
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,