Open schveiguy opened 1 year ago
A further thought on this, theSink
might need encoding. For example, if someChain
has text, and theSink accepts only ubyte, then an encoding needs to happen. arraycast should be enough, since that's a reasonable default. Supporting transcoding between character types also is a possibility for sinks that accept characters but not the same width.
More complex encodings should be handled with the push function.
Also, writeTo might not seem correct, maybe pushTo?
If you are writing a pipe to a sink, you have to do:
This can be simplified (and looks nicer as):
It's a simple wrapper, but is way more approachable. Obviously if someone wants more than just an outputPipe, they have to use the first form. But this is probably going to be the most common way to build an output iopipe.