Skip to main content

Gitmoji

Enum Gitmoji 

Source
pub enum Gitmoji {
    None,
    Prefix,
    Suffix,
    Replace,
}
Expand description

Where the type’s gitmoji goes, if anywhere.

Variants§

§

None

Leave the subject as written. The type prefix is still required and still validated — this decides decoration, never enforcement.

§

Prefix

✨ feat: add a cart

§

Suffix

feat: add a cart ✨ — the tooling-friendly placement: commitlint, changelog generators and git log --grep '^feat' all still see a clean conventional subject at the start of the line.

§

Replace

✨ add a cart — the emoji stands in for the type word.

You still write feat: add a cart, and it is still validated as such; only what gets stored differs. Know what it costs: the stored history is no longer parseable by conventional-commit tooling, because the type is now carried by an emoji. This mode chooses how the log looks over what can read it, and that is a real trade, not a free one.

Implementations§

Source§

impl Gitmoji

Source

pub const ALL: [Gitmoji; 4]

Source

pub fn as_str(self) -> &'static str

Source

pub fn parse(s: &str) -> Option<Gitmoji>

Source

pub fn explain(self) -> &'static str

The one-line description amont setup and amont list show, so the four words never have to be looked up elsewhere.

Source

pub fn example(self) -> String

feat: add a cart rendered in this placement, for a menu.

Trait Implementations§

Source§

impl Clone for Gitmoji

Source§

fn clone(&self) -> Gitmoji

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Gitmoji

Source§

impl Debug for Gitmoji

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Gitmoji

Source§

impl PartialEq for Gitmoji

Source§

fn eq(&self, other: &Gitmoji) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Gitmoji

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.