pub struct IndexedRLE<T: Clone + Eq, S = usize> {
pub token: T,
pub start: S,
}Expand description
Represents an individual run of a specific token.
Individual runs are of indefinite length by themselves. The end of the run (and thus the length) is dictated by the start value of the next run in your sequence.
Type T is the token value that you’re encoding.
Type S is the sequence index type. The default of usize should work for most cases, but you
can save space if you know that your token sequences have a length that can be specified with a smaller
sized type.
Fields§
§token: T§start: SImplementations§
Source§impl<T: Clone + Eq, S> IndexedRLE<T, S>
impl<T: Clone + Eq, S> IndexedRLE<T, S>
pub fn new(token: T, start: S) -> Self
Sourcepub fn memory_size(&self) -> usize
pub fn memory_size(&self) -> usize
The amount of memory it takes to store this data.
Trait Implementations§
Source§impl<T: Clone + Clone + Eq, S: Clone> Clone for IndexedRLE<T, S>
impl<T: Clone + Clone + Eq, S: Clone> Clone for IndexedRLE<T, S>
Source§fn clone(&self) -> IndexedRLE<T, S>
fn clone(&self) -> IndexedRLE<T, S>
Returns a duplicate 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<T: Clone + Eq, S: Copy + PartialEq + PartialOrd> MergableSpan for IndexedRLE<T, S>
impl<T: Clone + Eq, S: Copy + PartialEq + PartialOrd> MergableSpan for IndexedRLE<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for IndexedRLE<T, S>
impl<T, S> RefUnwindSafe for IndexedRLE<T, S>where
T: RefUnwindSafe,
S: RefUnwindSafe,
impl<T, S> Send for IndexedRLE<T, S>
impl<T, S> Sync for IndexedRLE<T, S>
impl<T, S> Unpin for IndexedRLE<T, S>
impl<T, S> UnsafeUnpin for IndexedRLE<T, S>where
T: UnsafeUnpin,
S: UnsafeUnpin,
impl<T, S> UnwindSafe for IndexedRLE<T, S>where
T: UnwindSafe,
S: UnwindSafe,
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