Skip to main content

gate_inbound

Function gate_inbound 

Source
pub fn gate_inbound(
    input: &[u8],
    context: InboundGateContext,
) -> Result<ParticipantFrame, InboundGateError>
Expand description

Applies the total R-D2 inbound gate to one declared complete frame.

The outer type is classified first. For participant frames, the declared complete size is then checked against the negotiated limit (or the fixed pre-capability ceiling) before structural body decoding can allocate. Structural failures map to their exact transport-rejection reason. Only after a complete structural decode does the gate test authentication and participant capability, in that order.

An SDK-side, structurally valid v1 ServerValue::ParticipantTransportRejected bypasses the two local state checks. This is the sole receive-side exception defined by R-D2.

ยงErrors

Returns InboundGateError::NotParticipantFrame without applying any participant rule when the outer type differs. Otherwise returns the exact pre-semantic ParticipantTransportRejected selected by R-D2 inside InboundGateError::ParticipantRejected.