Skip to content

Instantly share code, notes, and snippets.

@rrichardson
Last active August 29, 2015 14:09
Show Gist options
  • Save rrichardson/a98a30b8a4519b446f97 to your computer and use it in GitHub Desktop.
Save rrichardson/a98a30b8a4519b446f97 to your computer and use it in GitHub Desktop.
trait Subscriber<Input> {
fn on_subscribe(&self, s: &Subscription);
fn on_next(&self, t: Input);
fn on_error(&self, err: String);
fn on_complete(&self);
}
// how do I explain that Subscriber will outlive O and SingleStrategy as well? e.g. we can almost assume that Subscriber is static, // but not quite.
struct SingleStrategy<O> {
subscriber: Option<(Subscription, Subscriber<O>)>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment