pub enum EmergencyHandlerError {
Unauthorized,
BadRequest(String),
Kernel(String),
}Expand description
Errors returned by the emergency handlers. Each variant maps
cleanly onto an HTTP status code via EmergencyHandlerError::status.
Variants§
X-Admin-Token header missing or does not match the configured value.
Returns HTTP 401 and a minimal JSON error body.
BadRequest(String)
Request body could not be parsed as the expected JSON shape. The operator supplied bad input; returns HTTP 400.
Kernel(String)
Kernel-side failure while toggling the kill switch. Fail-closed:
the handler has already engaged the stop (see
handle_emergency_stop); this error just reports what went wrong
after the flag flipped. Returns HTTP 500.
Implementations§
Trait Implementations§
Source§impl Clone for EmergencyHandlerError
impl Clone for EmergencyHandlerError
Source§fn clone(&self) -> EmergencyHandlerError
fn clone(&self) -> EmergencyHandlerError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmergencyHandlerError
impl Debug for EmergencyHandlerError
Source§impl From<KernelError> for EmergencyHandlerError
impl From<KernelError> for EmergencyHandlerError
Source§fn from(error: KernelError) -> Self
fn from(error: KernelError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for EmergencyHandlerError
impl PartialEq for EmergencyHandlerError
impl Eq for EmergencyHandlerError
impl StructuralPartialEq for EmergencyHandlerError
Auto Trait Implementations§
impl Freeze for EmergencyHandlerError
impl RefUnwindSafe for EmergencyHandlerError
impl Send for EmergencyHandlerError
impl Sync for EmergencyHandlerError
impl Unpin for EmergencyHandlerError
impl UnsafeUnpin for EmergencyHandlerError
impl UnwindSafe for EmergencyHandlerError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.