1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use futures::Stream;

use super::{FluxChannel, FluxPipe};
use wasmrs_runtime::ConditionallySafe;

/// The wasmrs-rx implementation of an Rx Observable trait
pub trait Observable<Item, Err>: Stream<Item = Result<Item, Err>> + ConditionallySafe
where
  Item: ConditionallySafe,
  Err: ConditionallySafe,
  Self: Sized,
{
  /// Pipe one [Flux] into another.
  fn pipe(self, into: FluxChannel<Item, Err>) -> FluxPipe<Item, Err, Self> {
    FluxPipe::new(self, into)
  }
}