pub struct Next<'a> { /* private fields */ }Expand description
The continuation an Interceptor calls to run the rest of the chain.
Next holds the still-to-run interceptors and the terminal handler.
run consumes it: an interceptor can call next.run(req)
at most once. Not calling it at all short-circuits the chain.
Implementations§
Source§impl<'a> Next<'a>
impl<'a> Next<'a>
Sourcepub async fn run(self, req: UnaryRequest) -> Result<UnaryResponse, ConnectError>
pub async fn run(self, req: UnaryRequest) -> Result<UnaryResponse, 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 Next<'a>
impl<'a> !UnwindSafe for Next<'a>
impl<'a> Freeze for Next<'a>
impl<'a> Send for Next<'a>
impl<'a> Sync for Next<'a>
impl<'a> Unpin for Next<'a>
impl<'a> UnsafeUnpin for Next<'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