pub enum LighthouseError {
Config {
message: String,
},
ResourceNotFound {
resource_id: ResourceId,
},
InvalidMetric {
message: String,
},
CallbackFailed {
operation: String,
message: String,
},
EngineNotRunning {
message: String,
},
PolicyEvaluation {
policy_name: String,
message: String,
},
ChannelError {
message: String,
},
Serialization {
source: Error,
},
Io {
source: Error,
},
Unexpected {
message: String,
},
}
Expand description
All possible errors that can occur in the lighthouse library
Variants§
Config
Configuration-related errors
ResourceNotFound
Resource not found or invalid
Fields
§
resource_id: ResourceId
InvalidMetric
Invalid or missing metrics
CallbackFailed
Callback execution failed
EngineNotRunning
Engine is not running or has stopped
PolicyEvaluation
Policy evaluation failed
ChannelError
Channel communication error (internal)
Serialization
Serialization/deserialization errors
Io
IO-related errors
Unexpected
Generic error for unexpected situations
Implementations§
Source§impl LighthouseError
Helper methods for creating common errors
impl LighthouseError
Helper methods for creating common errors
pub fn config<S: Into<String>>(message: S) -> Self
pub fn resource_not_found<S: Into<String>>(resource_id: S) -> Self
pub fn invalid_metric<S: Into<String>>(message: S) -> Self
pub fn callback_failed<S: Into<String>>(operation: S, message: S) -> Self
pub fn engine_not_running<S: Into<String>>(message: S) -> Self
pub fn policy_evaluation<S: Into<String>>(policy_name: S, message: S) -> Self
pub fn unexpected<S: Into<String>>(message: S) -> Self
Trait Implementations§
Source§impl Debug for LighthouseError
impl Debug for LighthouseError
Source§impl Display for LighthouseError
impl Display for LighthouseError
Source§impl Error for LighthouseError
impl Error for LighthouseError
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()
Source§impl From<Error> for LighthouseError
impl From<Error> for LighthouseError
Source§impl From<Error> for LighthouseError
impl From<Error> for LighthouseError
Source§impl From<RecvError> for LighthouseError
Convert from channel receive errors
impl From<RecvError> for LighthouseError
Convert from channel receive errors
Auto Trait Implementations§
impl Freeze for LighthouseError
impl !RefUnwindSafe for LighthouseError
impl Send for LighthouseError
impl Sync for LighthouseError
impl Unpin for LighthouseError
impl !UnwindSafe for LighthouseError
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