Trait git_ref_format_core::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::Component
s, 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§
Provided Methods§
fn from_component(c: &Component<'_>) -> Option<Self>
Object Safety§
This trait is not object safe.