stream method
Returns a Stream of values ending once DisconnectedError is yielded.
Implementation
Stream<T> stream() async* {
while (true) {
final rec = await recv();
switch (rec) {
case Ok(:final ok):
yield ok;
case Err(:final err):
switch (err) {
case DisconnectedError():
return;
default:
}
}
}
}