StreamSinkTransformer<S, T> class
abstract
A StreamSinkTransformer transforms the events being passed to a sink.
This works on the same principle as a StreamTransformer. Each transformer defines a bind method that takes in the original StreamSink and returns the transformed version. However, where a StreamTransformer transforms events after they leave the stream, this transforms them before they enter the sink.
Transformers must be able to have bind
called used multiple times.
Constructors
-
StreamSinkTransformer.fromHandlers({void handleData(S, EventSink<
T> )?, void handleError(Object, StackTrace, EventSink<T> )?, void handleDone(EventSink<T> )?}) -
Creates a StreamSinkTransformer that delegates events to the given
handlers.
factory
-
StreamSinkTransformer.fromStreamTransformer(StreamTransformer<
S, T> transformer) -
Creates a StreamSinkTransformer that transforms events and errors
using
transformer
.constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bind(
StreamSink< T> sink) → StreamSink<S> -
Transforms the events passed to
sink
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
typed<
S, T> (StreamSinkTransformer transformer) → StreamSinkTransformer< S, T> -
Creates a wrapper that coerces the type of
transformer
.