use thiserror::Error;
#[derive(Error, Debug, PartialEq)]
pub enum Error {
#[error("failed to receive function result from the executor: {}", .0)]
ResultReceiveFailed(&'static str),
#[error("failed to send function result from within the runtime: {}", .0)]
ResultSendFailed(&'static str),
}
impl Error {
pub fn sender_disconnected() -> Self {
Self::ResultReceiveFailed("sender part has disconnected")
}
}
pub type Result<T> = std::result::Result<T, Error>;