removing dev branch, many changes

This commit is contained in:
John Smith
2023-05-29 19:24:57 +00:00
parent 1430f3f656
commit 0a890c8707
250 changed files with 18084 additions and 8040 deletions
+35
View File
@@ -32,6 +32,37 @@ macro_rules! bail_io_error_other {
};
}
cfg_if::cfg_if! {
if #[cfg(feature="rt-tokio")] {
#[macro_export]
macro_rules! asyncmutex_try_lock {
($x:expr) => {
$x.try_lock().ok()
};
}
#[macro_export]
macro_rules! asyncmutex_lock_arc {
($x:expr) => {
$x.clone().lock_owned().await
};
}
} else {
#[macro_export]
macro_rules! asyncmutex_try_lock {
($x:expr) => {
$x.try_lock()
};
}
#[macro_export]
macro_rules! asyncmutex_lock_arc {
($x:expr) => {
$x.lock_arc().await
};
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
pub fn system_boxed<'a, Out>(
@@ -99,6 +130,10 @@ pub fn ms_to_us(ms: u32) -> u64 {
(ms as u64) * 1000u64
}
pub fn us_to_ms(us: u64) -> EyreResult<u32> {
u32::try_from(us / 1000u64).wrap_err("could not convert microseconds")
}
// Calculate retry attempt with logarhythmic falloff
pub fn retry_falloff_log(
last_us: u64,