pub enum Error {
ToolNotFound(String),
Handler(String),
Serialization(Error),
Io(Error),
Http(String),
StateError(String),
Timeout,
}Variants§
ToolNotFound(String)
Handler(String)
Serialization(Error)
Io(Error)
Http(String)
StateError(String)
Timeout
Implementations§
Source§impl Error
impl Error
Sourcepub fn feature_disabled(feature: &str, subject: &str) -> Self
pub fn feature_disabled(feature: &str, subject: &str) -> Self
Error for functionality whose cargo feature was compiled out.
sse, websocket and http-handlers are optional, but a config naming
them still PARSES with them off — the config types are feature-independent,
and they have to be, or the same forge.yaml would mean different things
to different builds of the same version.
So the failure belongs here, at construction, naming the missing feature and how to get it back. The tempting alternatives are worse: a panic turns a configuration mistake into a crash with no remedy in the message, and silently skipping the thing leaves a server that starts, reports healthy, and does not serve what its operator configured.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more