mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 08:41:36 +00:00
*: Enable libp2p to run via wasm32-unknown-unknown in the browser (#2320)
Changes needed to get libp2p to run via `wasm32-unknown-unknown` in the browser (both main thread and inside web workers). Replaces wasm-timer with futures-timer and instant. Co-authored-by: Oliver Wangler <oliver@wngr.de>
This commit is contained in:
@ -24,6 +24,7 @@ use crate::protocol::{
|
||||
};
|
||||
use crate::record::{self, Record};
|
||||
use futures::prelude::*;
|
||||
use instant::Instant;
|
||||
use libp2p_core::{
|
||||
either::EitherOutput,
|
||||
upgrade::{self, InboundUpgrade, OutboundUpgrade},
|
||||
@ -37,7 +38,6 @@ use log::trace;
|
||||
use std::{
|
||||
error, fmt, io, marker::PhantomData, pin::Pin, task::Context, task::Poll, time::Duration,
|
||||
};
|
||||
use wasm_timer::Instant;
|
||||
|
||||
/// A prototype from which [`KademliaHandler`]s can be constructed.
|
||||
pub struct KademliaHandlerProto<T> {
|
||||
|
Reference in New Issue
Block a user