termal_core 5.0.0

This library contains implementation for the termal library
Documentation
use std::borrow::Cow;

use crate::progress::{BarIter, DotsIter};

pub trait ProgressExt: Sized + Iterator {
    /// Track the iterator progress using inline progress bar.
    fn progress_bar<'a>(
        self,
        task: impl Into<Cow<'a, str>>,
    ) -> BarIter<'a, Self> {
        BarIter::bar(self, task)
    }

    /// Track the iterator progress using inline dots.
    fn progress_dots<'a>(
        self,
        task: impl Into<Cow<'a, str>>,
    ) -> DotsIter<'a, Self> {
        DotsIter::dots(self, task)
    }
}

impl<T: Iterator> ProgressExt for T {}