Struct combine::state::IndexPositioner
[−]
[src]
pub struct IndexPositioner(_);
The IndexPositioner<Item, Range>
struct maintains the current index into the stream I
. The
initial index is index 0. Each Item
consumed increments the index by 1; each range
consumed
increments the position by range.len()
.
Methods
impl IndexPositioner
[src]
fn new() -> IndexPositioner
fn new_with_position(position: usize) -> IndexPositioner
Trait Implementations
impl Clone for IndexPositioner
[src]
fn clone(&self) -> IndexPositioner
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for IndexPositioner
[src]
impl Default for IndexPositioner
[src]
fn default() -> IndexPositioner
Returns the "default value" for a type. Read more
impl PartialEq for IndexPositioner
[src]
fn eq(&self, __arg_0: &IndexPositioner) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &IndexPositioner) -> bool
This method tests for !=
.
impl<Item> Positioner<Item> for IndexPositioner where
Item: PartialEq + Clone,
[src]
Item: PartialEq + Clone,
type Position = usize
The type which keeps track of the position
fn position(&self) -> usize
Returns the current position
fn update(&mut self, _item: &Item)
Updates the position given that item
has been taken from the stream
impl<Item, Range> RangePositioner<Item, Range> for IndexPositioner where
Item: PartialEq + Clone,
Range: PartialEq + Clone + Range,
[src]
Item: PartialEq + Clone,
Range: PartialEq + Clone + Range,
fn update_range(&mut self, range: &Range)
Updates the position given that range
has been taken from the stream