summaryrefslogblamecommitdiffstats
path: root/futures/src/executor/async_std.rs
blob: 641dfbd24308cf86a3b4f0e923108d4d237ae1f6 (plain) (tree)
1
2
3
4
5
6



                    

                                                










                                                                        
use crate::Executor;

use futures::Future;

/// A type representing the `async-std` runtime.
#[derive(Debug)]
pub struct AsyncStd;

impl Executor for AsyncStd {
    fn new() -> Result<Self, futures::io::Error> {
        Ok(Self)
    }

    fn spawn(&self, future: impl Future<Output = ()> + Send + 'static) {
        let _ = async_std::task::spawn(future);
    }
}