Make use_server_future accept FnMut (#2387)
This commit is contained in:
1 parent
5290b658fd
commit
40df088b7d
1 file changed
+1
-1
@@ -4,7 +4,7 @@ use std::future::Future;
|
|||||||
|
|
||||||
/// A future that resolves to a value.
|
/// A future that resolves to a value.
|
||||||
#[must_use = "Consider using `cx.spawn` to run a future without reading its value"]
|
#[must_use = "Consider using `cx.spawn` to run a future without reading its value"]
|
||||||
pub fn use_server_future<T, F>(_future: impl Fn() -> F + 'static) -> Option<Resource<T>>
|
pub fn use_server_future<T, F>(_future: impl FnMut() -> F + 'static) -> Option<Resource<T>>
|
||||||
where
|
where
|
||||||
T: Serialize + DeserializeOwned + 'static,
|
T: Serialize + DeserializeOwned + 'static,
|
||||||
F: Future<Output = T> + 'static,
|
F: Future<Output = T> + 'static,
|
||||||
|
|||||||
Reference in new issue
Block a user