// from the beginning every time. At some point we might support resuming for any node in the match
// tree: this requires some careful handling of tracking which on_no_match to use should we fail to
// for the use of HttpRequestHeaders : DataInput<HttpDataInput>, which is configured with the name
// DataType over time, allowing matching to be re-attempted as more data is made available. As such
// pause matching until we either match or have all the data. It would then fall on the caller to
// The result of a match. Use of ActionMatchResult over MatchResult indicates there is a configured
// action associated with the match. This is used to inject configuration into the matcher. In cases
// where there is no associated configuration (such as sub-matchers configured as part of a match
// - The match could not be completed due to lack of data (isInsufficientData() will return true.)
static ActionMatchResult insufficientData() { return ActionMatchResult(InsufficientData{}); }
bool isInsufficientData() const { return absl::holds_alternative<InsufficientData>(result_); }
// Returns the action by move. The caller must ensure that the ActionMatchResult is not used after
* MatchTree provides the interface for performing matches against the data provided by DataType.
// into ActionMatchResult values, and handle noMatch and insufficientData results as appropriate
handleRecursionAndSkips(const absl::optional<OnMatch<DataType>>& on_match, const DataType& data,
* string only. The name of core types (e.g., std::string, int) is defined string constrant which
* @return the default custom data of the expected type or nil. Life time must be bound by "this".
* Returns a string view match result. The input must ensure the backing data stays alive for the
// The resulting data. This will be absl::monostate() if we don't have sufficient data available
// DataInput which attempts to look a key up in the map: if we don't have access to the map yet,
// we return absl::monostate() with NotAvailable. If we have the entire map, but the key doesn't
* String is default data input type since nearly all the DataInput's derived objects' input type
* The category of this factory depends on the DataType, so we require a name() function to exist
* Interface for types providing a way to use a string for matching without depending on protocol