Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:async
  3. Stream<T>
  4. pipe method
pipe
description

pipe method

Futurepipe(
  1. StreamConsumer<T>streamConsumer
)

Pipes the events of this stream intostreamConsumer.

All events of this stream are added tostreamConsumer usingStreamConsumer.addStream.ThestreamConsumer is closed when this stream has been successfully addedto it - when the future returned byaddStream completes without an error.

Returns a future which completes when this stream has been consumedand the consumer has been closed.

The returned future completes with the same result as the future returnedbyStreamConsumer.close.If the call toStreamConsumer.addStream fails in some way, thismethod fails in the same way.

Implementation

Future pipe(StreamConsumer<T> streamConsumer) {  return streamConsumer.addStream(this).then((_) => streamConsumer.close());}
  1. Dart
  2. dart:async
  3. Stream<T>
  4. pipe method
Stream class

[8]ページ先頭

©2009-2025 Movatter.jp