Struct tokio_task_tracker::TaskSpawner
source · pub struct TaskSpawner { /* private fields */ }Expand description
TaskSpawner is used to spawn new task trackers.
Implementations§
source§impl TaskSpawner
impl TaskSpawner
sourcepub fn task(&self) -> TaskTracker
pub fn task(&self) -> TaskTracker
Create a new TaskTracker.
sourcepub fn spawn<T, F: FnOnce(TaskTracker) -> T>(
&self,
f: F
) -> JoinHandle<T::Output>where
T: Future + Send + 'static,
T::Output: Send + 'static,
pub fn spawn<T, F: FnOnce(TaskTracker) -> T>( &self, f: F ) -> JoinHandle<T::Output>where T: Future + Send + 'static, T::Output: Send + 'static,
Spawn a task.
The given closure will be called, passing in a task tracker.
Auto Trait Implementations§
impl RefUnwindSafe for TaskSpawner
impl Send for TaskSpawner
impl Sync for TaskSpawner
impl Unpin for TaskSpawner
impl UnwindSafe for TaskSpawner
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more