pub struct IndexPositioner(/* private fields */);
Expand description
The IndexPositioner<Item, Range>
struct maintains the current index into the stream Input
. The
initial index is index 0. Each Item
committed increments the index by 1; each range
committed
increments the position by range.len()
.
Implementations§
source§impl IndexPositioner
impl IndexPositioner
pub fn new() -> IndexPositioner
pub fn new_with_position(position: usize) -> IndexPositioner
Trait Implementations§
source§impl Clone for IndexPositioner
impl Clone for IndexPositioner
source§fn clone(&self) -> IndexPositioner
fn clone(&self) -> IndexPositioner
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for IndexPositioner
impl Debug for IndexPositioner
source§impl Default for IndexPositioner
impl Default for IndexPositioner
source§fn default() -> IndexPositioner
fn default() -> IndexPositioner
Returns the “default value” for a type. Read more
source§impl PartialEq for IndexPositioner
impl PartialEq for IndexPositioner
source§impl<Item> Positioner<Item> for IndexPositionerwhere
Item: Clone,
impl<Item> Positioner<Item> for IndexPositionerwhere
Item: Clone,
type Checkpoint = IndexPositioner
source§fn update(&mut self, _item: &Item)
fn update(&mut self, _item: &Item)
Updates the position given that
token
has been taken from the streamfn checkpoint(&self) -> Self::Checkpoint
fn reset(&mut self, checkpoint: Self::Checkpoint)
source§impl<Item, Range> RangePositioner<Item, Range> for IndexPositioner
impl<Item, Range> RangePositioner<Item, Range> for IndexPositioner
source§fn update_range(&mut self, range: &Range)
fn update_range(&mut self, range: &Range)
Updates the position given that
range
has been taken from the streamimpl StructuralPartialEq for IndexPositioner
Auto Trait Implementations§
impl Freeze for IndexPositioner
impl RefUnwindSafe for IndexPositioner
impl Send for IndexPositioner
impl Sync for IndexPositioner
impl Unpin for IndexPositioner
impl UnwindSafe for IndexPositioner
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)