2021-01-21 06:09:53 +00:00
|
|
|
pub mod peer_tracker;
|
|
|
|
pub mod request_response;
|
2021-03-03 04:45:43 +00:00
|
|
|
pub mod spot_price;
|
2021-01-21 06:09:53 +00:00
|
|
|
pub mod transport;
|
|
|
|
|
2020-10-15 22:14:39 +00:00
|
|
|
use futures::prelude::*;
|
2021-03-03 02:26:12 +00:00
|
|
|
use libp2p::core::Executor;
|
2020-10-15 22:14:39 +00:00
|
|
|
use std::pin::Pin;
|
|
|
|
use tokio::runtime::Handle;
|
|
|
|
|
2020-12-23 03:33:29 +00:00
|
|
|
#[allow(missing_debug_implementations)]
|
2020-10-15 22:14:39 +00:00
|
|
|
pub struct TokioExecutor {
|
|
|
|
pub handle: Handle,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Executor for TokioExecutor {
|
|
|
|
fn exec(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) {
|
|
|
|
let _ = self.handle.spawn(future);
|
|
|
|
}
|
|
|
|
}
|