#[non_exhaustive]pub enum RpcErrorCode {
NotFound,
InvalidConfig,
SpawnFailed,
ProtocolMismatch,
Internal,
DeadlineExceeded,
}Expand description
Machine-readable RPC error codes
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotFound
Selector matched nothing
InvalidConfig
Config failed validation daemon-side
SpawnFailed
Spawn failed (exec error, permissions)
ProtocolMismatch
Handshake protocol version mismatch
Internal
Unexpected daemon-side failure
DeadlineExceeded
The request’s deadline expired before the daemon finished it
Implementations§
Source§impl RpcErrorCode
impl RpcErrorCode
Sourcepub const ALL: [Self; 6]
pub const ALL: [Self; 6]
Every variant, for code that needs to iterate them all.
#[non_exhaustive] forces a _ arm on any match written outside
this crate, which would silently swallow a variant added here and
never updated there (shep-cli’s exit-code mapping test is the
motivating case — see crates/shep-cli/src/exit.rs). Downstream
crates should iterate ALL instead of hand-writing their own list
that the compiler can’t check.
Kept honest by a private assert_all_lists_every_variant fn right
below: read that doc for how a forgotten variant is caught here,
where #[non_exhaustive] has no effect.
Trait Implementations§
Source§impl Clone for RpcErrorCode
impl Clone for RpcErrorCode
Source§fn clone(&self) -> RpcErrorCode
fn clone(&self) -> RpcErrorCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RpcErrorCode
Source§impl Debug for RpcErrorCode
impl Debug for RpcErrorCode
Source§impl<'de> Deserialize<'de> for RpcErrorCode
impl<'de> Deserialize<'de> for RpcErrorCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RpcErrorCode
Source§impl PartialEq for RpcErrorCode
impl PartialEq for RpcErrorCode
Source§impl Serialize for RpcErrorCode
impl Serialize for RpcErrorCode
impl StructuralPartialEq for RpcErrorCode
Auto Trait Implementations§
impl Freeze for RpcErrorCode
impl RefUnwindSafe for RpcErrorCode
impl Send for RpcErrorCode
impl Sync for RpcErrorCode
impl Unpin for RpcErrorCode
impl UnsafeUnpin for RpcErrorCode
impl UnwindSafe for RpcErrorCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.