[][src]Struct metrics_util::layers::FilterLayer

pub struct FilterLayer { /* fields omitted */ }

A layer for filtering and discarding metrics matching certain name patterns.

More information on the behavior of the layer can be found in Filter.

Implementations

impl FilterLayer[src]

pub fn from_patterns<P, I>(patterns: P) -> Self where
    P: IntoIterator<Item = I>,
    I: AsRef<str>, 
[src]

Creates a FilterLayer from an existing set of patterns.

pub fn add_pattern<P>(&mut self, pattern: P) -> &mut FilterLayer where
    P: AsRef<str>, 
[src]

Adds a pattern to match.

pub fn case_insensitive(&mut self, case_insensitive: bool) -> &mut FilterLayer[src]

Sets the case sensitivity used for pattern matching.

Defaults to false i.e. searches are case sensitive.

pub fn use_dfa(&mut self, dfa: bool) -> &mut FilterLayer[src]

Sets whether or not to internally use a deterministic finite automaton.

Per the docs for the aho-corasick crate, enabling the DFA trades off space usage and build time (at runtime, not compile time) in order to reduce the search time complexity. Using the DFA is beneficial when matching a small number of short patterns, which should be fairly common when filtering metrics.

Defaults to true.

Trait Implementations

impl Default for FilterLayer[src]

impl<R> Layer<R> for FilterLayer[src]

type Output = Filter<R>

The output type after wrapping.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.