func (o ObservableFoo) Single() ObservableFoo {
	return o.AsObservable().Single().AsObservableFoo()
}
jig:template Observable<Foo> Single
Single enforces that the observableFoo sends exactly one data item and then
completes. If the observable sends no data before completing or sends more
than 1 item before completing  this reported as an error to the observer.
package rx
func (o Observable) DistinctUntilChanged(equal ...func(interface{}, interface{}) bool) Observable {
	observable := func(observe Observer, subscribeOn Scheduler, subscriber Subscriber) {
		if len(equal) == 0 {
			equal = append(equal, func(prev, curr interface{}) bool { return prev == curr })
		}
		var seen struct {
			initialized bool
			value       interface{}
		}
		observer := func(next interface{}, err error, done bool) {
			if !done {
				if seen.initialized && equal[0](seen.value, next) {
					return  
				} else {
					seen.initialized = true
					seen.value = next
				}
			}
			observe(next, err, done)
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}
func (o ObservableFoo) DistinctUntilChanged(equal ...func(foo, foo) bool) ObservableFoo {
	var same []func(interface{}, interface{}) bool
	if len(equal) != 0 {
		same = append(same, func(prev, curr interface{}) bool { return equal[0](prev.(foo), curr.(foo)) })
	}
	return o.AsObservable().DistinctUntilChanged(same...).AsObservableFoo()
}
func (o Observable) Distinct() Observable {
	observable := func(observe Observer, subscribeOn Scheduler, subscriber Subscriber) {
		seen := map[interface{}]struct{}{}
		observer := func(next interface{}, err error, done bool) {
			if !done {
				if _, present := seen[next]; present {
					return
				}
				seen[next] = struct{}{}
			}
			observe(next, err, done)
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}
func (o ObservableFoo) Distinct() ObservableFoo {
	return o.AsObservable().Distinct().AsObservableFoo()
}
func (o Observable) ElementAt(n int) Observable {
	observable := func(observe Observer, subscribeOn Scheduler, subscriber Subscriber) {
		i := 0
		observer := func(next interface{}, err error, done bool) {
			if done || i == n {
				observe(next, err, done)
			}
			i++
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}
func (o ObservableFoo) ElementAt(n int) ObservableFoo {
	return o.AsObservable().ElementAt(n).AsObservableFoo()
}
func (o ObservableFoo) Filter(predicate func(next foo) bool) ObservableFoo {
	observable := func(observe FooObserver, subscribeOn Scheduler, subscriber Subscriber) {
		observer := func(next foo, err error, done bool) {
			if done || predicate(next) {
				observe(next, err, done)
			}
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}
func (o Observable) First() Observable {
	observable := func(observe Observer, subscribeOn Scheduler, subscriber Subscriber) {
		start := true
		observer := func(next interface{}, err error, done bool) {
			if done || start {
				observe(next, err, done)
			}
			start = false
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}
func (o ObservableFoo) First() ObservableFoo {
	return o.AsObservable().First().AsObservableFoo()
}
func (o Observable) IgnoreElements() Observable {
	observable := func(observe Observer, subscribeOn Scheduler, subscriber Subscriber) {
		observer := func(next interface{}, err error, done bool) {
			if done {
				observe(next, err, done)
			}
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}
func (o ObservableFoo) IgnoreElements() ObservableFoo {
	return o.AsObservable().IgnoreElements().AsObservableFoo()
}
func (o Observable) IgnoreCompletion() Observable {
	observable := func(observe Observer, subscribeOn Scheduler, subscriber Subscriber) {
		observer := func(next interface{}, err error, done bool) {
			if !done {
				observe(next, err, done)
			}
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}
func (o ObservableFoo) IgnoreCompletion() ObservableFoo {
	return o.AsObservable().IgnoreCompletion().AsObservableFoo()
}
func (o Observable) Last() Observable {
	observable := func(observe Observer, subscribeOn Scheduler, subscriber Subscriber) {
		have := false
		var last interface{}
		observer := func(next interface{}, err error, done bool) {
			if done {
				if have {
					observe(last, nil, false)
				}
				observe(nil, err, true)
			} else {
				last = next
				have = true
			}
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}
func (o ObservableFoo) Last() ObservableFoo {
	return o.AsObservable().Last().AsObservableFoo()
}
const DidNotEmitValue = RxError("expected one value, got none")
const EmittedMultipleValues = RxError("expected one value, got multiple")
func (o Observable) Single() Observable {
	observable := func(observe Observer, subscribeOn Scheduler, subscriber Subscriber) {
		var (
			count  int
			latest interface{}
		)
		observer := func(next interface{}, err error, done bool) {
			if count < 2 {
				if done {
					if err != nil {
						observe(nil, err, true)
					} else {
						if count == 1 {
							observe(latest, nil, false)
							observe(nil, nil, true)
						} else {
							observe(nil, DidNotEmitValue, true)
						}
					}
				} else {
					count++
					if count == 1 {
						latest = next
					} else {
						observe(nil, EmittedMultipleValues, true)
					}
				}
			}
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}