spawn_local_on_result
function · ferroui-system · v0.5.0
fn spawn_local_on_result<F, T>(future: F, schedule: std::sync::Arc<dyn Schedule>, first_poll: super::schedule::FirstPoll) -> super::join::JoinHandle<T>
where F: Future<Output = Result<T, super::join::JoinError>> + 'static,
T: 'static
Runs future as a task of the current thread whose polls run on schedule, as
spawn_local_on, and gives a handle whose outcome is the output of the future: Ok(value)
is the value of the task, and Err(error) ends the task with error, as if it had been
aborted (JoinError::Canceled) or had panicked (JoinError::Panicked, whose payload
the future makes). A future reports the failure of its task this way without unwinding, so
that the failure reaches the observers of the handle with panic = "abort" too (#567). A
panic of the future still fails the task as with spawn_local_on, and an abort still
cancels it.
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.