Treatment filter

std/flow::filter


Generics

◻ T (any)

Inputs

⇥ select: Stream<bool>
⇥ value: Stream<T>

Outputs

↦ accepted: Stream<T>
↦ rejected: Stream<T>


Filter a stream according to bool stream.

ℹ️ If both streams are not the same size nothing is sent through accepted nor rejected.

graph LR
     T("filter()")
     V["… 🟦 🟧 🟪 🟫 🟨 …"] -->|value| T
     D["… 🟩 🟥 🟥 🟩 🟥 …"] -->|select|T
     
     T -->|accepted| A["… 🟦 🟫 …"]
     T -->|rejected| R["… 🟧 🟪 🟨 …"]

     style V fill:#ffff,stroke:#ffff
     style D fill:#ffff,stroke:#ffff
     style A fill:#ffff,stroke:#ffff
     style R fill:#ffff,stroke:#ffff