vrl/datadog/filter/
resolver.rs

1use super::{Field, normalize_fields};
2
3/// A `Resolver` is type that can build and return an `IntoIterator` of Datadog Search
4/// Syntax `Field`s. These are intended to be passed along to `Filter` methods as pre-parsed
5/// field types which can be used to determine which logic is necessary to match against.
6pub trait Resolver {
7    /// Builds fields, and returns an iterator. Takes a immutable ref to self to allow for
8    /// recursion when building filters. A type that implements `Resolver` + `Filter` and needs
9    /// to update an internal cache when building fields should use interior mutability.
10    fn build_fields(&self, attr: &str) -> Vec<Field> {
11        normalize_fields(attr).into_iter().collect()
12    }
13}