Sinkable
Abstract type for values that implement the (sink) protocol.
Sinkable values can be converted into sinks explicitly and used for type
testing.
Sinkable is not constructible directly.
Methods
sink
Returns a sink over the value.
Returns
Forwarded methods
x.foo(...) on a Sinkable means x.sink().foo(...), so Sink's
methods can be called on the value directly:
| Method | Description |
|---|---|
put value |
Writes a value |
premap func |
Transforms each value before it is written |
prefilter pred |
Writes only values for which pred is truthy |
premap/prefilter are named for their direction — they act on values headed
into the sink. A value that is both Sinkable and
Iterable, such as an Array, offers those
alongside map/filter, which run the opposite way: