pub trait DeltaDecoderExt: Iterator{
// Provided method
fn original(self) -> DeltaDecoderIter<Self> ⓘ
where Self: Sized { ... }
}
Provided Methods§
Sourcefn original(self) -> DeltaDecoderIter<Self> ⓘwhere
Self: Sized,
fn original(self) -> DeltaDecoderIter<Self> ⓘwhere
Self: Sized,
Construct a delta-decoded iterator from an iterator.
The first element of the iterator is used as the starting point for the delta-encoding.
Note that unlike the [DeltaDecoder.decode
] method, this method will panic if the delta is too large.
§Example
use delta_encoding::DeltaDecoderExt;
// Consuming original data into a delta-decoded iterator.
let mut decoded: Vec<i64> = vec![1, 1, 3, -1, -2].into_iter().original().collect();
assert_eq!(decoded, vec![1, 2, 5, 4, 2]);
// Non-consuming original data, but avoiding the allocation of a new vector.
let mut decoded: Vec<i64> = vec![1, 1, 3, -1, -2].iter().copied().original().collect();
assert_eq!(decoded, vec![1, 2, 5, 4, 2]);