pub struct NextStream<'a> { /* private fields */ }Expand description
The continuation an Interceptor calls to run the rest of a
streaming chain.
NextStream holds the still-to-run interceptors and the terminal
handler. run consumes it: an interceptor can call
next.run(req, inbound) at most once. Not calling it short-circuits.
Unlike Next, this is not Clone: the inbound stream is consumed as
it is read and cannot be replayed, so a streaming chain runs once by
construction.
Implementations§
Source§impl<'a> NextStream<'a>
impl<'a> NextStream<'a>
Sourcepub async fn run(
self,
req: StreamRequest,
inbound: PayloadStream,
) -> Result<StreamResponse, ConnectError>
pub async fn run( self, req: StreamRequest, inbound: PayloadStream, ) -> Result<StreamResponse, ConnectError>
Run the rest of the chain — the next interceptor if any, otherwise the terminal handler — and return its response.
§Errors
Returns whatever error the next interceptor or handler produced.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for NextStream<'a>
impl<'a> !UnwindSafe for NextStream<'a>
impl<'a> Freeze for NextStream<'a>
impl<'a> Send for NextStream<'a>
impl<'a> Sync for NextStream<'a>
impl<'a> Unpin for NextStream<'a>
impl<'a> UnsafeUnpin for NextStream<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more