pub struct JsonRpcFallback { /* private fields */ }Expand description
Mounts crate::jsonrpc::Router as the socket router’s catch-all.
Why: see the module docs — the dispatcher already owns the method surface,
and registering those 33 names a second time here is the drift this avoids.
What: rebuilds the Request envelope the dispatcher takes and hands back
either half of its trusty_mcp::Response. The id is 0 on the way in
and discarded on the way out — RpcRouter stamps the caller’s real id
onto the response frame, so the one supplied here would only be
overwritten. The context is the same throwaway
crate::serve::rest::throwaway_ctx builds, because a one-frame-in,
one-frame-out connection has nowhere to push a notification to; the one
handler that would try is served as a stream instead.
Test: uds_tests::fallback_dispatches_every_jsonrpc_router_method,
uds_tests::fallback_reports_an_unknown_method.
Trait Implementations§
Source§impl RpcFallback for JsonRpcFallback
impl RpcFallback for JsonRpcFallback
Auto Trait Implementations§
impl !RefUnwindSafe for JsonRpcFallback
impl !UnwindSafe for JsonRpcFallback
impl Freeze for JsonRpcFallback
impl Send for JsonRpcFallback
impl Sync for JsonRpcFallback
impl Unpin for JsonRpcFallback
impl UnsafeUnpin for JsonRpcFallback
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more