Last active: 9 months ago
rust accept async function in generic
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>,
}