1 struct TestDisposable 2 { 3 void dispose() 4 { 5 } 6 } 7 8 struct TestObserver 9 { 10 void put(int n) 11 { 12 } 13 14 void completed() 15 { 16 } 17 18 void failure(Exception e) 19 { 20 } 21 } 22 23 struct TestObservable 24 { 25 alias ElementType = int; 26 27 TestDisposable subscribe(TestObserver observer) 28 { 29 return TestDisposable(); 30 } 31 } 32 33 static assert(isSubscribable!(TestObservable, TestObserver));
Test if the observer can subscribe to the observable.