#[cfg(not(any(
feature = "futures-lock",
feature = "tokio-lock",
feature = "async-std-lock"
)))]
compile_error!(
"Must enable one of: futures-lock, tokio-lock, or async-std-lock"
);
#[cfg(test)]
pub use crate::reexported::test::*;
#[cfg(test)]
mod test;
feature_cfg! {
for "std";
use std::collections::{HashMap, HashSet};
pub use std::{
boxed::Box,
format,
future::Future,
iter::{self, IntoIterator, Iterator},
mem,
num::NonZeroUsize,
pin::Pin,
sync::Arc,
vec::Vec,
};
pub type Map<K, V> = HashMap<K, V>;
pub type Set<T> = HashSet<T>;
}
feature_cfg! {
for !"std";
extern crate alloc;
use alloc::collections::{BTreeMap, BTreeSet};
pub use alloc::{
boxed::Box,
format,
sync::Arc,
vec::Vec,
};
pub use core::{
future::Future,
iter::{self, IntoIterator, Iterator},
mem,
num::NonZeroUsize,
pin::Pin,
};
pub type Map<K, V> = BTreeMap<K, V>;
pub type Set<T> = BTreeSet<T>;
}
feature_cfg! {
for "futures-lock";
pub use futures::lock::Mutex;
}
feature_cfg! {
for "tokio-lock";
pub use tokio::sync::Mutex;
}
feature_cfg! {
for "async-std-lock";
pub use async_lock::Mutex;
}