Struct mit_commit::Trailer [−][src]
pub struct Trailer { /* fields omitted */ }
Expand description
A Trailer
you might see a in a CommitMessage
, for example
‘Co-authored-by: Billie Thompson billie@example.com’
Implementations
Create a new Trailer
This creates a new element that represents the sort of Trailers
you
get at the end of commits
For example there’s Co-authored-by
, Relates-to
, and Signed-off-by
Example
use std::convert::TryFrom;
use mit_commit::{Body, Trailer};
assert_eq!(
Trailer::new("Co-authored-by", "#124"),
Trailer::try_from(Body::from("Co-authored-by: #124"))
.expect("There should have been a trailer in that body component")
)
Get the key of the Trailer
Example
use std::convert::TryFrom;
use mit_commit::{Body, Trailer};
assert_eq!(
Trailer::new("Co-authored-by", "#124").get_key(),
"Co-authored-by"
)
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Trailer
impl UnwindSafe for Trailer
Blanket Implementations
Mutably borrows from an owned value. Read more