[][src]Struct mit_commit::Bodies

pub struct Bodies { /* fields omitted */ }

A collection of user input CommitMessage text

Implementations

impl Bodies[src]

#[must_use]pub fn first(&self) -> Option<Body>[src]

Get the first Body in this list of Bodies

Examples

use mit_commit::{Bodies, Body, Subject};

let bodies: Vec<Body> = Vec::default();
assert_eq!(None, Bodies::from(bodies).first());

let bodies: Vec<Body> = vec![
    Body::from("First"),
    Body::from("Second"),
    Body::from("Third"),
];
assert_eq!(Some(Body::from("First")), Bodies::from(bodies).first());

#[must_use]pub fn iter(&self) -> Iter<Body>[src]

Iterate over the Body in the Bodies

Examples

use mit_commit::Bodies;
use mit_commit::Body;
let trailers = Bodies::from(vec![
    Body::from("Body 1"),
    Body::from("Body 2"),
    Body::from("Body 3"),
]);
let mut iterator = trailers.iter();

assert_eq!(iterator.next(), Some(&Body::from("Body 1")));
assert_eq!(iterator.next(), Some(&Body::from("Body 2")));
assert_eq!(iterator.next(), Some(&Body::from("Body 3")));
assert_eq!(iterator.next(), None);

Trait Implementations

impl Clone for Bodies[src]

impl Debug for Bodies[src]

impl Display for Bodies[src]

impl From<Bodies> for String[src]

impl From<Vec<Body>> for Bodies[src]

impl From<Vec<Fragment>> for Bodies[src]

impl PartialEq<Bodies> for Bodies[src]

impl StructuralPartialEq for Bodies[src]

Auto Trait Implementations

impl RefUnwindSafe for Bodies

impl Send for Bodies

impl Sync for Bodies

impl Unpin for Bodies

impl UnwindSafe for Bodies

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.