[][src]Trait libhoney::FieldHolder

pub trait FieldHolder {
    pub fn add(&mut self, data: HashMap<String, Value>);
pub fn add_field(&mut self, name: &str, value: Value);
pub fn add_func<F>(&mut self, func: F)
    where
        F: Fn() -> Result<(String, Value)>
; }

FieldHolder implements common functions that operate on the fields component of a struct (usually Event or Builder). This avoids some duplication of code.

Required methods

pub fn add(&mut self, data: HashMap<String, Value>)[src]

add data to the current (event/builder) fields

pub fn add_field(&mut self, name: &str, value: Value)[src]

add_field adds a field to the current (event/builder) fields

pub fn add_func<F>(&mut self, func: F) where
    F: Fn() -> Result<(String, Value)>, 
[src]

add_func iterates over the results from func (until Err) and adds the results to the event/builder fields

Loading content...

Implementors

impl FieldHolder for Builder[src]

pub fn add_field(&mut self, name: &str, value: Value)[src]

add_field adds a field to the current (event/builder) fields

pub fn add_func<F>(&mut self, func: F) where
    F: Fn() -> Result<(String, Value)>, 
[src]

add_func iterates over the results from func (until Err) and adds the results to the event/builder fields

impl FieldHolder for Event[src]

pub fn add_field(&mut self, name: &str, value: Value)[src]

add_field adds a field to the current (event/builder) fields

pub fn add_func<F>(&mut self, func: F) where
    F: Fn() -> Result<(String, Value)>, 
[src]

add_func iterates over the results from func (until Err) and adds the results to the event/builder fields

Loading content...