MCPcopy Create free account
hub / github.com/Firstyear/opensuse-proxy-cache / poll_shutdown

Method poll_shutdown

opensuse-proxy-cache/src/main.rs:814–830  ·  view source on GitHub ↗
(mut self: Pin<&mut Self>, cx: &mut Context<'_>)

Source from the content-addressed store, hash-verified

812 }
813
814 fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
815 let mut this = self.as_mut().project();
816
817 let res_a = this.sink_a.poll_shutdown(cx);
818 let res_b = this.sink_b.poll_shutdown(cx);
819
820 match (res_a, res_b) {
821 (Poll::Ready(Ok(())), Poll::Ready(Ok(()))) => Poll::Ready(Ok(())),
822 (Poll::Ready(Err(err)), _) => Poll::Ready(Err(err)),
823 (res_a, Poll::Ready(Err(_err))) => {
824 eprintln!("sink b -> err");
825 *this.sink_b_state = SinkState::Err;
826 res_a
827 }
828 (Poll::Pending, _) | (_, Poll::Pending) => Poll::Pending,
829 }
830 }
831}
832
833pin_project! {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected