[−][src]Struct mit_commit::Trailer
A Trailer you might see a in a CommitMessage, for example 'Co-authored-by: Billie Thompson billie@example.com'
Implementations
impl Trailer[src]
#[must_use]pub fn new(key: &str, value: &str) -> Trailer[src]
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 mit_commit::{Body, Trailer}; use std::convert::TryFrom; 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") )
#[must_use]pub fn get_key(&self) -> String[src]
Get the key of the Trailer
Example
use mit_commit::{Body, Trailer}; use std::convert::TryFrom; assert_eq!( Trailer::new("Co-authored-by", "#124").get_key(), "Co-authored-by" )
#[must_use]pub fn get_value(&self) -> String[src]
Get the value of the Trailer
Example
use mit_commit::{Body, Trailer}; use std::convert::TryFrom; assert_eq!(Trailer::new("Co-authored-by", "#124").get_value(), "#124")
Trait Implementations
impl Clone for Trailer[src]
impl Debug for Trailer[src]
impl Eq for Trailer[src]
impl From<Trailer> for String[src]
impl From<Trailer> for Fragment[src]
impl Hash for Trailer[src]
fn hash<H: Hasher>(&self, state: &mut H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl Ord for Trailer[src]
fn cmp(&self, other: &Trailer) -> Ordering[src]
#[must_use]fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self[src]
impl PartialEq<Trailer> for Trailer[src]
impl PartialOrd<Trailer> for Trailer[src]
fn partial_cmp(&self, other: &Trailer) -> Option<Ordering>[src]
fn lt(&self, other: &Trailer) -> bool[src]
fn le(&self, other: &Trailer) -> bool[src]
fn gt(&self, other: &Trailer) -> bool[src]
fn ge(&self, other: &Trailer) -> bool[src]
impl StructuralEq for Trailer[src]
impl TryFrom<Body> for Trailer[src]
Auto Trait Implementations
impl RefUnwindSafe for Trailer
impl Send for Trailer
impl Sync for Trailer
impl Unpin for Trailer
impl UnwindSafe for Trailer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,