pub struct GitmojiMap { /* private fields */ }Expand description
Resolved branch_type → shortcode table. The BTreeMap choice is
load-bearing: it gives deterministic iteration order (alphabetical
by branch type), which gwm types --gitmoji relies on so a CI diff
against the previous run is byte-stable.
Implementations§
Source§impl GitmojiMap
impl GitmojiMap
Sourcepub fn get(&self, branch_type: &str) -> Option<&str>
pub fn get(&self, branch_type: &str) -> Option<&str>
Look up the shortcode for a branch type. Returns None for types
not in the table — callers (notably resolve_prefix) decide
the fallback policy.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
Iterate over (branch_type, shortcode) pairs in deterministic
(alphabetical) order. Used by gwm types --gitmoji and the
“every default has a unicode” test sweep.
Sourcepub fn insert(
&mut self,
branch_type: impl Into<String>,
shortcode: impl Into<String>,
)
pub fn insert( &mut self, branch_type: impl Into<String>, shortcode: impl Into<String>, )
Merge another (branch_type, shortcode) pair into the table.
Overrides the existing entry if any. Public so external callers
(e.g. tests, future programmatic surfaces) can build a custom
map without round-tripping through TOML.
Trait Implementations§
Source§impl Clone for GitmojiMap
impl Clone for GitmojiMap
Source§fn clone(&self) -> GitmojiMap
fn clone(&self) -> GitmojiMap
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GitmojiMap
impl Debug for GitmojiMap
Source§impl Default for GitmojiMap
impl Default for GitmojiMap
Source§fn default() -> GitmojiMap
fn default() -> GitmojiMap
Auto Trait Implementations§
impl Freeze for GitmojiMap
impl RefUnwindSafe for GitmojiMap
impl Send for GitmojiMap
impl Sync for GitmojiMap
impl Unpin for GitmojiMap
impl UnsafeUnpin for GitmojiMap
impl UnwindSafe for GitmojiMap
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more