Module timelog::task_line_iter

source ·
Expand description

Iterator filter for walking relevant task lines from an iterator

Given an iterator, a start date, and an end date, gives a new iterator that only returns the lines starting from the first on or after the start date and ending before the end date.

Examples

use std::io::{BufRead, BufReader};
use timelog::task_line_iter::TaskLineIter;
let iter = TaskLineIter::new(
              BufReader::new(file).lines().take_while(|ol| ol.is_ok())
                                          .map(|ol| ol.unwrap()),
              "2021-06-06", "2021-06-08"
           );

Any iterator returning strings will work. Getting lines from a file, takes a bit more effort.

Structs

  • Iterator that walks lines of interest in the timelog file.