Line data Source code
1 : // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 : // for details. All rights reserved. Use of this source code is governed by a
3 : // BSD-style license that can be found in the LICENSE file.
4 :
5 : import 'dart:async';
6 :
7 : import '../delegate/stream_sink.dart';
8 : import '../stream_sink_transformer.dart';
9 :
10 : /// A wrapper that coerces the generic type of the sink returned by an inner
11 : /// transformer to `S`.
12 : class TypeSafeStreamSinkTransformer<S, T>
13 : implements StreamSinkTransformer<S, T> {
14 : final StreamSinkTransformer _inner;
15 :
16 0 : TypeSafeStreamSinkTransformer(this._inner);
17 :
18 : StreamSink<S> bind(StreamSink<T> sink) =>
19 0 : DelegatingStreamSink.typed(_inner.bind(sink));
20 : }
|