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>
pub fn spawn<T, F: FnOnce(TaskTracker) -> T>( &self, f: F, ) -> JoinHandle<T::Output>
Spawn a task.
The given closure will be called, passing in a task tracker.
Trait Implementations§
source§impl Clone for TaskSpawner
impl Clone for TaskSpawner
source§fn clone(&self) -> TaskSpawner
fn clone(&self) -> TaskSpawner
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for TaskSpawner
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)