#[repr(u16)]pub enum RpcStatus {
Ok = 0,
NotFound = 1,
Unauthorized = 2,
Timeout = 3,
Backpressure = 4,
Cancelled = 5,
Internal = 6,
UnknownVersion = 7,
CapabilityDenied = 8,
Application(u16),
}Expand description
Outcome of an nRPC call. Net-native numbering with documented
gRPC equivalents (see comments). Numeric stability: callers and
servers across versions agree on 0x0000..=0x7FFF; the
application-defined range is 0x8000..=0xFFFF.
Variants§
Ok = 0
Success. Payload carries the application response. Terminal
(or, for streaming responses, may be one of many — see the
streaming flag).
gRPC equivalent: OK (0).
NotFound = 1
No service registered with the requested name on the server.
gRPC equivalent: NOT_FOUND (5).
Caller’s token doesn’t list the requested service in scope,
or the channel-level capability check failed.
gRPC equivalent: PERMISSION_DENIED (7).
Timeout = 3
Server observed now_ns() > deadline_ns before starting work.
(For the in-flight case after the handler started, see
DISPATCH_RPC_DEADLINE_EXCEEDED.)
gRPC equivalent: DEADLINE_EXCEEDED (4).
Backpressure = 4
Server’s per-service queue is at max_in_flight capacity.
gRPC equivalent: RESOURCE_EXHAUSTED (8).
Cancelled = 5
Caller emitted DISPATCH_RPC_CANCEL before the server
completed.
gRPC equivalent: CANCELLED (1).
Internal = 6
Handler panicked or returned an error not classified as one
of the above. Payload carries a UTF-8 diagnostic.
gRPC equivalent: INTERNAL (13).
UnknownVersion = 7
Request payload version not supported by the server. Should
normally be caught earlier by subprotocol-version
negotiation; the in-payload guard is the floor.
gRPC equivalent: UNIMPLEMENTED (12).
CapabilityDenied = 8
v0.4 capability-auth: the target’s CapabilityAnnouncement
either does not list the requested nrpc:<service> tag, or
lists it with allow-lists the caller does not match. See
docs/plans/CAPABILITY_AUTH_PLAN.md §3. Distinct from
Unauthorized (channel-auth / token-scope failures) so
operators can tell the two enforcement surfaces apart in
audit logs.
gRPC equivalent: PERMISSION_DENIED (7) — same outward
shape as Unauthorized but a separate substrate code.
Application(u16)
Application-defined status. The wire carries the raw u16; callers / servers agree on the meaning out of band.
Implementations§
Trait Implementations§
impl Copy for RpcStatus
impl Eq for RpcStatus
impl StructuralPartialEq for RpcStatus
Auto Trait Implementations§
impl Freeze for RpcStatus
impl RefUnwindSafe for RpcStatus
impl Send for RpcStatus
impl Sync for RpcStatus
impl Unpin for RpcStatus
impl UnsafeUnpin for RpcStatus
impl UnwindSafe for RpcStatus
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,
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.