Struct mit_commit::Bodies [−][src]
pub struct Bodies { /* fields omitted */ }
Expand description
A collection of user input CommitMessage
text
Implementations
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());
Iterate over the Body
in the Bodies
Examples
use mit_commit::{Bodies, 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
Iterate over the Body
in the Bodies
Examples
use mit_commit::{Bodies, Body};
let trailers = Bodies::from(vec![
Body::from("Body 1"),
Body::from("Body 2"),
Body::from("Body 3"),
]);
let mut iterator = trailers.into_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);
Auto Trait Implementations
impl RefUnwindSafe for Bodies
impl UnwindSafe for Bodies
Blanket Implementations
Mutably borrows from an owned value. Read more