pub enum RpcError {
NoRoute {
target: u64,
reason: String,
},
Timeout {
elapsed_ms: u64,
},
ServerError {
status: u16,
message: String,
},
Transport(AdapterError),
Codec {
direction: CodecDirection,
message: String,
},
CapabilityDenied {
target: u64,
capability: String,
},
Cancelled,
}Expand description
What MeshNode::call returns on failure.
Variants§
NoRoute
No subscription / no route to the target. Either
target_node_id is unknown to the local mesh, or the
caller’s reply-channel subscription couldn’t be set up.
Fields
Timeout
Caller’s deadline elapsed before a RESPONSE arrived. The caller emits a CANCEL on timeout so the server can drop the in-flight handler; this variant is returned to the awaiting caller.
ServerError
Server returned a non-Ok status. Body carries the
server’s diagnostic (UTF-8) when available.
Fields
Transport(AdapterError)
Underlying transport error (publish failure, encryption, etc.).
Codec
Client-local serialization or deserialization failure.
direction = Encode means the typed wrapper failed to
encode the request before it ever hit the wire;
direction = Decode means the response landed but the
typed wrapper failed to decode it. Either way this is a
caller-fixable bug (wrong codec, schema drift, malformed
Serialize impl) — NOT a transient infra failure — so
retry / circuit-breaker predicates skip it by default.
Fields
direction: CodecDirectionWhich side of the call the codec failure happened on.
CapabilityDenied
v0.4 capability-auth gate denied the call. Either the
target’s latest CapabilityAnnouncement does not list
the requested nrpc:<service> tag, or it lists the tag
with allow-lists the caller does not match. See
docs/plans/CAPABILITY_AUTH_PLAN.md §3 for the model.
Raised by the caller-side gate inside
MeshNode::call_service BEFORE the request hits the
wire, and surfaced by the caller on receipt of a
RpcStatus::CapabilityDenied response (the callee-side
defense-in-depth path).
Fields
Cancelled
Caller-side cancellation fired via
MeshNode::cancel with the call’s cancel_token.
Triggers a Drop-on-cancel CANCEL frame on the wire so the
server’s in-flight handler observes the cancel; the
awaiting caller returns this variant. NOT retried by the
default retry policy — cancellation is caller-driven and
re-issuing the call defeats the point.
Trait Implementations§
Source§impl Error for RpcError
impl Error for RpcError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()