Skip to main content

LabelIndexReader

Trait LabelIndexReader 

Source
pub trait LabelIndexReader {
    // Required methods
    fn label_names(&self) -> Result<Vec<String>>;
    fn label_values(&self, name: &str) -> Result<Vec<String>>;
}
Expand description

Read-only access to the label space of an index.

Both methods are sorted and deduplicated, which is what the index guarantees on disk: names are returned in lexicographic order and exclude the internal all-series key, and the values of one name follow the index’s order.

The trait is object safe, so &dyn LabelIndexReader works.

Required Methods§

Source

fn label_names(&self) -> Result<Vec<String>>

All label names present in the block, sorted.

Source

fn label_values(&self, name: &str) -> Result<Vec<String>>

All values of name, sorted; empty when the name is absent.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§