1#[cfg(feature = "alloc")]
9use alloc::boxed::Box;
10use rshyper::error::Error as CoreError;
11use rshyper::idx::RawIndex;
12pub type Result<T = ()> = core::result::Result<T, Error>;
14
15#[derive(Debug, strum::EnumIs, thiserror::Error)]
18pub enum Error {
19 #[cfg(feature = "alloc")]
20 #[error("Not Found: {0}")]
21 NotFound(Box<dyn RawIndex>),
22 #[error("No path found between the two points")]
23 PathNotFound,
24 #[error(transparent)]
25 CoreError(#[from] CoreError),
26}
27
28#[cfg(feature = "alloc")]
29impl From<Error> for CoreError {
30 fn from(e: Error) -> Self {
31 match e {
32 Error::CoreError(e) => e,
33 _ => CoreError::BoxError(Box::new(e)),
34 }
35 }
36}