vrl 0.32.0

Vector Remap Language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::{Field, normalize_fields};

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