Treatment resize

std/flow/vec::resize


Generics

◻ T (any)

Parameters

↳ var default: T

Inputs

⇥ size: Stream<u64>
⇥ vector: Stream<Vec<T>>

Outputs

↦ resized: Stream<Vec<T>>


Resize vectors according to given streamed size.

If a vector is smaller than expected size, it is extended using the default value.

graph LR
     T("resize(default=🟨)")
     V["[🟦 🟦][🟦][][🟦 🟦 🟦]…"] -->|vector| T
     S["3️⃣ 2️⃣ 3️⃣ 2️⃣ …"] -->|size| T
     
     T -->|resized| P["[🟦 🟦 🟨][🟦 🟨][🟨 🟨 🟨][🟦 🟦]…"]

     style V fill:#ffff,stroke:#ffff
     style S fill:#ffff,stroke:#ffff
     style P fill:#ffff,stroke:#ffff