CurveIterator

Trait CurveIterator 

Source
pub trait CurveIterator: Debug {
    type CurveKind: CurveType;

    // Required method
    fn next_window(
        &mut self,
    ) -> Option<Window<<Self::CurveKind as CurveType>::WindowKind>>;

    // Provided methods
    fn collect_curve<R: FromCurveIterator<Self::CurveKind>>(self) -> R
       where Self: Sized { ... }
    fn reclassify<O>(self) -> ReclassifyIterator<Self, O>
       where Self: Sized { ... }
    fn normalize(
        self,
    ) -> JoinAdjacentIterator<CurveIteratorIterator<Self>, <Self::CurveKind as CurveType>::WindowKind, Self::CurveKind>
       where Self: Sized { ... }
    fn take_while_curve<F>(
        self,
        fun: F,
    ) -> TakeWhile<CurveIteratorIterator<Self>, F>
       where Self: Sized,
             F: for<'a> FnMut(&'a Window<<Self::CurveKind as CurveType>::WindowKind>) -> bool { ... }
    fn fuse_curve(self) -> Fuse<CurveIteratorIterator<Self>>
       where Self: Sized { ... }
    fn into_iterator(self) -> CurveIteratorIterator<Self> 
       where Self: Sized { ... }
}
Expand description

Trait representing an Iterator that has almost the guarantees of a curve:

  1. Windows ordered by start
  2. Windows non-overlapping or adjacent (this differs from Curves as it allows adjacent windows)
  3. Windows non-empty

Or in other words all finite prefixes of the Iterator are a valid Curves

Required Associated Types§

Source

type CurveKind: CurveType

The type of the curve being iterated

Required Methods§

Source

fn next_window( &mut self, ) -> Option<Window<<Self::CurveKind as CurveType>::WindowKind>>

calculate and returns the next window of the curve iterator advancing the iterator in the process

Provided Methods§

Source

fn collect_curve<R: FromCurveIterator<Self::CurveKind>>(self) -> R
where Self: Sized,

collect the iterator mirroring core::iter::Iterator::collect

Source

fn reclassify<O>(self) -> ReclassifyIterator<Self, O>
where Self: Sized,

reclassify a CurveIterator

Source

fn normalize( self, ) -> JoinAdjacentIterator<CurveIteratorIterator<Self>, <Self::CurveKind as CurveType>::WindowKind, Self::CurveKind>
where Self: Sized,

normalize the CurveIterator by combining adjacent windows

Source

fn take_while_curve<F>( self, fun: F, ) -> TakeWhile<CurveIteratorIterator<Self>, F>
where Self: Sized, F: for<'a> FnMut(&'a Window<<Self::CurveKind as CurveType>::WindowKind>) -> bool,

Basically core::iter::Iterator::take_while but for CurveIterator

Source

fn fuse_curve(self) -> Fuse<CurveIteratorIterator<Self>>
where Self: Sized,

Basically core::iter::Iterator::fuse but for CurveIterator

Source

fn into_iterator(self) -> CurveIteratorIterator<Self>
where Self: Sized,

Wrap the CurveIterator to allow usage of standart Iterator adapters

Implementations on Foreign Types§

Source§

impl<'b, C> CurveIterator for Box<dyn ClonableCurveIterator<'b, CurveKind = C>>
where C: CurveType,

Source§

impl<CI: CurveIterator> CurveIterator for &mut CI

Source§

impl<CI: CurveIterator> CurveIterator for Box<CI>

Source§

impl<W> CurveIterator for Empty<Window<W>>
where W: WindowType,

Source§

impl<W, P, CI> CurveIterator for TakeWhile<CI, P>
where W: WindowType, P: for<'r> FnMut(&'r Window<W>) -> bool, CI: CurveIterator + Iterator<Item = Window<W>>, CI::CurveKind: CurveType<WindowKind = W>,

Source§

impl<W: WindowType, CI> CurveIterator for Fuse<CI>
where CI: CurveIterator + Iterator<Item = Window<W>>, CI::CurveKind: CurveType<WindowKind = W>,

Implementors§

Source§

impl CurveIterator for TaskDemandIterator

Source§

impl<AC, CDC> CurveIterator for ActualServerExecutionIterator<AC, CDC>
where AC: CurveIterator<CurveKind = UnconstrainedServerExecution>, CDC: CurveIterator, CDC::CurveKind: CurveType<WindowKind = Demand>,

Source§

impl<C, I> CurveIterator for IterCurveWrapper<I, C>
where Self: Debug, C: CurveType, I: Iterator<Item = Window<C::WindowKind>>,

Source§

impl<C, I> CurveIterator for JoinAdjacentIterator<I, C::WindowKind, C>
where Self: Debug, C: CurveType, I: Iterator<Item = Window<C::WindowKind>>,

Source§

impl<C: CurveType> CurveIterator for CurveIter<C>

Source§

impl<I> CurveIterator for ConstrainedServerDemandIterator<I>
where I: CurveIterator<CurveKind = AggregatedServerDemand>,

Source§

impl<I> CurveIterator for CurveIteratorIterator<I>
where I: CurveIterator,

Source§

impl<I, O> CurveIterator for ReclassifyIterator<I, O>
where I: CurveIterator, O: CurveType,

Source§

impl<I, W> CurveIterator for AggregationIterator<I, W>
where I: CurveIterator, I::CurveKind: CurveType<WindowKind = W>, W: Debug,

Source§

impl<I: CurveIterator, C: CurveType> CurveIterator for InverseCurveIterator<I, C>

Source§

impl<W, I, C> CurveIterator for CapacityCheckIterator<W, I, C>
where I: CurveIterator<CurveKind = C>, C: CurveType<WindowKind = W> + Debug, W: WindowType,