Implement dummy Mutex, Condvar and RwLock
[rust-lightning] / lightning / src / lib.rs
index a9f46b43a4026f650069cb97f9baf1dd62a0d968..14445710655b277f32eaeb1033a475b3b3c53c9e 100644 (file)
@@ -44,5 +44,20 @@ pub mod ln;
 pub mod routing;
 
 mod prelude {
-       pub use alloc::{vec, vec::Vec, string::String};
-}
\ No newline at end of file
+       #[cfg(feature = "hashbrown")]
+       extern crate hashbrown;
+
+       pub use alloc::{vec, vec::Vec, string::String, collections::VecDeque};
+       #[cfg(not(feature = "hashbrown"))]
+       pub use std::collections::{HashMap, HashSet, hash_map};
+       #[cfg(feature = "hashbrown")]
+       pub use self::hashbrown::{HashMap, HashSet, hash_map};
+}
+
+#[cfg(feature = "std")]
+mod sync {
+       pub use ::std::sync::{Arc, Mutex, Condvar, MutexGuard, RwLock, RwLockReadGuard};
+}
+
+#[cfg(not(feature = "std"))]
+mod sync;