(task: T)
| 38 | |
| 39 | impl<R: 'static> SpawnedTask<R> { |
| 40 | pub fn spawn<T>(task: T) -> Self |
| 41 | where |
| 42 | T: Future<Output = R>, |
| 43 | T: Send + 'static, |
| 44 | R: Send, |
| 45 | { |
| 46 | // Ok to use spawn here as SpawnedTask handles aborting/cancelling the task on Drop |
| 47 | #[expect(clippy::disallowed_methods)] |
| 48 | let inner = tokio::task::spawn(trace_future(task)); |
| 49 | Self { inner } |
| 50 | } |
| 51 | |
| 52 | pub fn spawn_blocking<T>(task: T) -> Self |
| 53 | where |