#![cfg_attr(docsrs, feature(doc_cfg))]
use std::future::Future;
use tokio::task::JoinHandle;
use url::Url;
pub mod auth_tokens;
pub mod cli;
pub mod dp;
pub mod hpke;
pub mod http;
pub mod report_id;
pub mod retries;
#[cfg(feature = "test-util")]
#[cfg_attr(docsrs, doc(cfg(feature = "test-util")))]
pub mod test_util;
pub mod time;
pub mod vdaf;
pub trait Runtime {
fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
where
F: Future + Send + 'static,
F::Output: Send + 'static;
}
pub struct TokioRuntime;
impl Runtime for TokioRuntime {
fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
where
F: Future + Send + 'static,
F::Output: Send + 'static,
{
tokio::task::spawn(future)
}
}
pub mod taskprov {
pub const TASKPROV_HEADER: &str = "dap-taskprov";
}
pub fn url_ensure_trailing_slash(mut url: Url) -> Url {
if !url.as_str().ends_with('/') {
url.set_path(&format!("{}/", url.path()));
}
url
}