Type Alias regex_automata::util::captures::CaptureNameMap
source · type CaptureNameMap = HashMap<Arc<str>, SmallIndex>;
Expand description
A map from capture group name to its corresponding capture group index.
This type is actually wrapped inside a Vec indexed by pattern ID on a
GroupInfo
, since multiple patterns may have the same capture group name.
That is, each pattern gets its own namespace of capture group names.
Perhaps a more memory efficient representation would be
HashMap<(PatternID, ArcArc<str>
, which requires
an allocation. To fix this, I think we’d need to define our own unsized
type or something? Anyway, I didn’t give this much thought since it
probably doesn’t matter much in the grand scheme of things. But it did
stand out to me as mildly wasteful.
Aliased Type§
struct CaptureNameMap { /* private fields */ }