influxdb-rs/influxdb-rust

Allow specifying Option<T> values

msrd0 opened this issue · 0 comments

msrd0 commented

Currently, a struct looking like this gives an error:

#[derive(InfluxDbWriteable)]                                                                                                                                                                                                                                                  
struct InsertStatus                                                                                                                                                                                                                                                           
{                                                                                                                                                                                                                                                                             
    time: Timestamp,                                                                                                                                                                                                                                                         
    event_count: Option<u64>,                                                                                                                                                                                                                                                
    run: Option<bool>,                                                                                                                                                                                                                                                       
    auto: Option<bool>,                                                                                                                                                                                                                                                      
    error: Option<bool>                                                                                                                                                                                                                                                      
}

It would probably be sufficient to simply ignore the type if it is None.