Created
January 30, 2024 02:30
-
-
Save DefectingCat/8bed10eb7eafa739791df63e2972526e to your computer and use it in GitHub Desktop.
rust accept async function in generic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{collections::HashMap, future::Future}; | |
pub struct Rymo<'a, F, Fut> | |
where | |
F: FnOnce() -> Fut + 'static + Send + Sync, | |
Fut: Future<Output = ()>, | |
{ | |
pub port: String, | |
pub handle: HashMap<&'a str, F>, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment