[][src]Struct mit_commit::Comments

pub struct Comments { /* fields omitted */ }

A collection of comments from a CommitMessage

Implementations

impl Comments[src]

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

Iterate over the Comment in the Comments

Examples

use mit_commit::Comment;
use mit_commit::Comments;

let trailers = Comments::from(vec![
    Comment::from("# Comment 1"),
    Comment::from("# Comment 2"),
    Comment::from("# Comment 3"),
]);
let mut iterator = trailers.iter();

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

Trait Implementations

impl Clone for Comments[src]

impl Debug for Comments[src]

impl From<Comments> for String[src]

impl From<Vec<Comment>> for Comments[src]

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

impl PartialEq<Comments> for Comments[src]

impl StructuralPartialEq for Comments[src]

Auto Trait Implementations

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, 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.