File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 4747 }
4848}
4949
50+ mod private_try_future {
51+ use super :: Future ;
52+
53+ pub trait Sealed { }
54+
55+ impl < F , T , E > Sealed for F where F : ?Sized + Future < Output = Result < T , E > > { }
56+ }
57+
5058/// A convenience for futures that return `Result` values that includes
5159/// a variety of adapters tailored to such futures.
52- pub trait TryFuture {
60+ pub trait TryFuture : private_try_future :: Sealed {
5361 /// The type of successful values yielded by this future
5462 type Ok ;
5563
Original file line number Diff line number Diff line change @@ -112,9 +112,17 @@ where
112112 }
113113}
114114
115+ mod private_try_stream {
116+ use super :: Stream ;
117+
118+ pub trait Sealed { }
119+
120+ impl < S , T , E > Sealed for S where S : ?Sized + Stream < Item = Result < T , E > > { }
121+ }
122+
115123/// A convenience for streams that return `Result` values that includes
116124/// a variety of adapters tailored to such futures.
117- pub trait TryStream {
125+ pub trait TryStream : private_try_stream :: Sealed {
118126 /// The type of successful values yielded by this future
119127 type Ok ;
120128
You can’t perform that action at this time.
0 commit comments