Trait git_ref_format::lit::Lit

source ·
pub trait Lit: Sized + Sealed {
    const SELF: Self;
    const NAME: &'static RefStr;

    // Provided method
    fn from_component(c: &Component<'_>) -> Option<Self> { ... }
}
Expand description

A literal RefStr.

Types implementing Lit must be name::Components, and provide a conversion from a component iff the component’s RefStr representation is equal to Lit::NAME. Because these morphisms can only be guaranteed axiomatically, the trait can not currently be implemented by types outside of this crate.

Lit types are useful for efficiently creating known-valid Qualified refs, and sometimes for pattern matching.

Required Associated Constants§

source

const SELF: Self

source

const NAME: &'static RefStr

Provided Methods§

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Lit for Heads

source§

const SELF: Heads = Self

source§

const NAME: &'static RefStr = name::HEADS

source§

impl Lit for Namespaces

source§

const SELF: Namespaces = Self

source§

const NAME: &'static RefStr = name::NAMESPACES

source§

impl Lit for Notes

source§

const SELF: Notes = Self

source§

const NAME: &'static RefStr = name::NOTES

source§

impl Lit for Refs

source§

const SELF: Refs = Self

source§

const NAME: &'static RefStr = name::REFS

source§

impl Lit for Remotes

source§

const SELF: Remotes = Self

source§

const NAME: &'static RefStr = name::REMOTES

source§

impl Lit for Tags

source§

const SELF: Tags = Self

source§

const NAME: &'static RefStr = name::TAGS