Module pat

Source
Expand description

String pattern matching.

§Overview

In the library, pattern matching is used to initialize delimiters for deserializers, like Delimited and DelimitedEntries, and for validating string config params. Pattern matching essentially generalizes the Pattern trait from the standard library. Since the trait itself is unstable, we don’t use it directly; instead, we define the Split trait and implement it for &str and [char; _] (via Pattern) and for Regexes from the eponymous crate (via the LazyRegex wrapper; see its docs for why this wrapper is needed).

§Examples

Macros§

lazy_regex
Creates a LazyRegex.

Structs§

LazyRegex
Transparent wrapper around a type dereferencing to a Regex. Can be used as a separator, or in param validation.
Regex
A compiled regular expression for searching Unicode haystacks.

Traits§

Split
Pattern usable for splitting strings. Used in Delimited and DelimitedEntries deserializers.