Struct rle_vec::Run[][src]

pub struct Run<T> {
    pub len: usize,
    pub value: T,
}

Represent a run inside the RleVec, can be obtained from the runs. A run is a serie of the same value.

Example

let rle = RleVec::from(&[1, 1, 1, 1, 2, 2, 3][..]);

let mut iterator = rle.runs();
assert_eq!(iterator.next(), Some(Run{ len: 4, value: &1 }));
assert_eq!(iterator.next(), Some(Run{ len: 2, value: &2 }));
assert_eq!(iterator.next(), Some(Run{ len: 1, value: &3 }));

Fields

len: usize

The length of this run.

value: T

The value of this run.

Trait Implementations

impl<T: Clone> Clone for Run<T>[src]

impl<T: Debug> Debug for Run<T>[src]

impl<T: Eq> Eq for Run<T>[src]

impl<T: Eq> Extend<Run<T>> for RleVec<T>[src]

impl<T: Eq> FromIterator<Run<T>> for RleVec<T>[src]

impl<T: Hash> Hash for Run<T>[src]

impl<T: Ord> Ord for Run<T>[src]

impl<T: PartialEq> PartialEq<Run<T>> for Run<T>[src]

impl<T: PartialOrd> PartialOrd<Run<T>> for Run<T>[src]

impl<T> StructuralEq for Run<T>[src]

impl<T> StructuralPartialEq for Run<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Run<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Run<T> where
    T: Send
[src]

impl<T> Sync for Run<T> where
    T: Sync
[src]

impl<T> Unpin for Run<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Run<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.