LCOV - code coverage report
Current view: top level - proxy/src - util.rs (source / functions) Coverage Total Hit
Test: 157166bf1e7b60cf936c3c96f6e44d24268705a4.info Lines: 0.0 % 8 0
Test Date: 2025-07-08 19:05:57 Functions: 0.0 % 4 0

            Line data    Source code
       1              : use std::pin::pin;
       2              : 
       3              : use futures::future::{Either, select};
       4              : use tokio_util::sync::CancellationToken;
       5              : 
       6            0 : pub async fn run_until_cancelled<F: Future>(
       7            0 :     f: F,
       8            0 :     cancellation_token: &CancellationToken,
       9            0 : ) -> Option<F::Output> {
      10            0 :     match select(pin!(f), pin!(cancellation_token.cancelled())).await {
      11            0 :         Either::Left((f, _)) => Some(f),
      12            0 :         Either::Right(((), _)) => None,
      13              :     }
      14            0 : }
        

Generated by: LCOV version 2.1-beta