std1.0.0-beta-7 SafeC docs

std :: collections::traits

Function std::drain_into

#include <std/collections/traits.h> source

generic<Q: Dequeue, S: Push> unsigned long drain_into(&Q q, &S out)

Dequeues until q is empty (a Chan: until it is closed and drained) and pushes each element onto out, in order. Returns how many moved. Meant for a growable out (Vec): an element out refuses is dropped and draining stops there.