pub struct RpcError {
pub code: RpcErrorCode,
pub message: String,
pub daemon_version: Option<String>,
}Expand description
Structured RPC failure
Fields§
§code: RpcErrorCodeMachine-readable code
message: StringHuman-readable message (plain English, no theme)
daemon_version: Option<String>The daemon’s own crate version, when it chose to name it.
Set on a RpcErrorCode::ProtocolMismatch refusal, where it is the
only place a client can learn it: the refusal reports the daemon’s
PROTOCOL, and HelloAck::daemon_version never arrives. shep daemon reload picks its mechanism by version, and a protocol bump is
exactly when that choice matters.
None on every other error, and on any refusal from a daemon built
before this field existed — which no upgrade can change, so a reader
must treat None as “unknown” and take the conservative path.
Additive by construction: absent on the wire rather than null, and
ignored by a client too old to know it, so
crate::protocol::PROTOCOL_VERSION does not move for it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RpcError
impl<'de> Deserialize<'de> for RpcError
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 RpcError
impl StructuralPartialEq for RpcError
Auto Trait Implementations§
impl Freeze for RpcError
impl RefUnwindSafe for RpcError
impl Send for RpcError
impl Sync for RpcError
impl Unpin for RpcError
impl UnsafeUnpin for RpcError
impl UnwindSafe for RpcError
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.