pub fn start<'f, F, T>(f: F) -> JoinHandle<'f, T>where
F: FnOnce() -> T + 'f,
T: 'f,
Expand description
Creates a new fiber and yields execution to it immediately, returning a
JoinHandle
for the new fiber.
The current fiber performs a yield and the execution is transfered to the new fiber immediately.
Panicking
If JoinHandle::join
is not called on the join handle, a panic will
happen when the join handle is dropped.
This will create a fiber using default parameters of Builder
, if you
want to specify the stack size or the name of the thread, use builder’s API
instead.