Treatment insert

std/flow::insert


Generics

◻ T (any)

Inputs

⇥ block: Block<T>
⇥ stream: Stream<T>

Outputs

↦ output: Stream<T>


Insert a block into a stream.

block is inserted into stream when it comes and everything is streamed to output.

ℹ️ No assumption on block insertion position in stream can be made.

graph LR
     T("insert()")
     A["… 🟦 🟦 🟦 🟦 …"] -->|stream| T
     B["〈🟧〉"] -->|block| T
     

     T -->|output| V["… 🟦 🟧 🟦 🟦 🟦 …"]

     style V fill:#ffff,stroke:#ffff
     style A fill:#ffff,stroke:#ffff
     style B fill:#ffff,stroke:#ffff