1 unstable release

0.1.0 Mar 25, 2021

#2393 in Algorithms

MIT/Apache

5KB
79 lines

Latest version Documentation MIT Apache

iter_vec

Description

usable for vertex and index buffer temporary storage.

Usage

let content0 = vec![1, 2, 3, 4];
let content1 = [5, 6, 7, 8];
let content2 = [9, 0];
let iter_vec = ExactSizedIterVec::build_from_vec(vec![     
    content0.iter(),
    content1.iter(),
    content2.iter(),]);
let flat: Vec<i32> = iter_vec.copied().collect();
assert_eq!(vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 0], flat)

lib.rs:

This crate provide vector of iterator

This crate aims to ExactSizeIterator for Vec<&[T]>

usable for vertex and index buffer temporary storage

#[test]
fn demo() {
let content0 = vec![1, 2, 3, 4];
let content1 = [5, 6, 7, 8];
let content2 = [9, 0];
let iter_vec = ExactSizedIterVec::build_from_vec(vec![
content0.iter(),
content1.iter(),
content2.iter(),
]);
let flat: Vec<i32> = iter_vec.copied().collect();
assert_eq!(vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 0], flat)
}

!

No runtime deps