mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-26 16:21:39 +00:00
fix(swarm): Make executors pub and add convenience constructors for SwarmBuilder (#3155)
Addresses issues raised here: https://github.com/libp2p/rust-libp2p/pull/3097#discussion_r1026526312
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
//! Provides executors for spawning background tasks.
|
||||
use futures::executor::ThreadPool;
|
||||
use std::{future::Future, pin::Pin};
|
||||
|
||||
@ -30,7 +31,7 @@ impl Executor for ThreadPool {
|
||||
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
|
||||
))]
|
||||
#[derive(Default, Debug, Clone, Copy)]
|
||||
pub(crate) struct TokioExecutor;
|
||||
pub struct TokioExecutor;
|
||||
|
||||
#[cfg(all(
|
||||
feature = "tokio",
|
||||
@ -47,7 +48,7 @@ impl Executor for TokioExecutor {
|
||||
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
|
||||
))]
|
||||
#[derive(Default, Debug, Clone, Copy)]
|
||||
pub(crate) struct AsyncStdExecutor;
|
||||
pub struct AsyncStdExecutor;
|
||||
|
||||
#[cfg(all(
|
||||
feature = "async-std",
|
||||
|
Reference in New Issue
Block a user