Skip to main content

ps_promise/rejection/task_failure/implementations/from/panic/
mod.rs

1mod helpers;
2
3use std::any::Any;
4
5use helpers::panic_message;
6
7use crate::TaskFailure;
8
9impl From<Box<dyn Any + Send + 'static>> for TaskFailure {
10    fn from(payload: Box<dyn Any + Send + 'static>) -> Self {
11        Self::Panic(panic_message(&*payload).into())
12    }
13}