[][src]Struct mit_commit::Body

pub struct Body { /* fields omitted */ }

A single contiguous block of CommitMessage text

Implementations

impl Body[src]

#[must_use]pub fn append(&self, additional: &Body) -> Body[src]

Append one body onto another

This is for concatenating multiple bodies together

Example

use indoc::indoc;
use mit_commit::Body;

assert_eq!(
    Body::from(indoc!(
        "
        Example 1
        Example 2"
    )),
    Body::from("Example 1").append(&Body::from("Example 2"))
)

#[must_use]pub fn is_empty(&self) -> bool[src]

Is this body empty

Empty bodies usually indicate a paragraph break in commit messages so it's handy to be able to see them.

Example

use indoc::indoc;
use mit_commit::Body;

assert_eq!(Body::from("").is_empty(), true)

Trait Implementations

impl Clone for Body[src]

impl Debug for Body[src]

impl Default for Body[src]

impl Display for Body[src]

impl<'_> From<&'_ str> for Body[src]

impl From<Body> for String[src]

impl From<Body> for Subject[src]

impl From<String> for Body[src]

impl PartialEq<Body> for Body[src]

impl StructuralPartialEq for Body[src]

impl TryFrom<Body> for Trailer[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Body

impl Send for Body

impl Sync for Body

impl Unpin for Body

impl UnwindSafe for Body

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.