pub struct RpcClientFold { /* private fields */ }Expand description
Client-side fold. Decodes RESPONSE events and routes them to
awaiting oneshots in the shared RpcClientPending.
Mesh::call clones the same Arc<RpcClientPending> to register
oneshots before publishing REQUESTs.
Implementations§
Source§impl RpcClientFold
impl RpcClientFold
Sourcepub fn new(pending: Arc<RpcClientPending>) -> Self
pub fn new(pending: Arc<RpcClientPending>) -> Self
Construct a client fold that delivers responses through
pending. Typical pattern:
let pending = Arc::new(RpcClientPending::new());
let fold = RpcClientFold::new(pending.clone());
let adapter = CortexAdapter::open(..., fold, ())?;
// `pending` is still usable for register / cancel.Sourcepub fn apply_inbound(&mut self, ev: &RpcInboundEvent)
pub fn apply_inbound(&mut self, ev: &RpcInboundEvent)
Production-path entry point. Mesh dispatch calls this with
the AEAD-verified session peer’s NodeId in
ev.from_node; the pending registry’s S-4 binding gate
uses it to reject responses from the wrong target.
Trait Implementations§
Source§impl RedexFold<()> for RpcClientFold
impl RedexFold<()> for RpcClientFold
Source§fn apply(&mut self, ev: &RedexEvent, _state: &mut ()) -> Result<(), RedexError>
fn apply(&mut self, ev: &RedexEvent, _state: &mut ()) -> Result<(), RedexError>
Legacy entry point used by loopback / test paths that
don’t have a session peer to resolve. Calls deliver
with from_node = 0, which the pending registry treats
as “no binding” — callers that registered with
target_node = 0 accept it, callers that registered
with a real target reject it.