[][src]Struct git_conventional::Commit

pub struct Commit<'a> { /* fields omitted */ }

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.

See: https://git-scm.com/docs/git-interpret-trailers

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.