pub struct Trailer<'a> { /* private fields */ }
Expand description
A Trailer
you might see a in a [CommitMessage
], for example
‘Co-authored-by: Billie Thompson billie@example.com’
Implementations§
Source§impl<'a> Trailer<'a>
impl<'a> Trailer<'a>
Sourcepub const fn new(key: Cow<'a, str>, value: Cow<'a, str>) -> Self
pub const fn new(key: Cow<'a, str>, value: Cow<'a, str>) -> Self
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".into(), "#124".into()),
Trailer::try_from(Body::from("Co-authored-by: #124"))
.expect("There should have been a trailer in that body component")
)
Trait Implementations§
Source§impl<'a> Ord for Trailer<'a>
impl<'a> Ord for Trailer<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialOrd for Trailer<'a>
impl<'a> PartialOrd for Trailer<'a>
impl<'a> Eq for Trailer<'a>
Auto Trait Implementations§
impl<'a> Freeze for Trailer<'a>
impl<'a> RefUnwindSafe for Trailer<'a>
impl<'a> Send for Trailer<'a>
impl<'a> Sync for Trailer<'a>
impl<'a> Unpin for Trailer<'a>
impl<'a> UnwindSafe for Trailer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more