pub async fn apply_initial_request<Fut, Err>(
recv_initial: impl FnOnce(InitialMessageType) -> Fut,
protocol: &SharedServerProtocol,
apply: impl FnOnce(&mut dyn ShapeDeserializer) -> Result<(), SerdeError>,
) -> Result<(), DeserializeError>Expand description
Applies the initial-request frame, when the protocol carries one, to the operation input
being built.
apply receives a codec deserializer over the frame’s payload and reads the non-stream
input members into the caller’s builder. When the protocol does not frame initial messages,
or the stream starts with an ordinary event, nothing is consumed and apply is not called.
recv_initial reads the frame — pass the receiver’s try_recv_initial, e.g.
|message_type| receiver.try_recv_initial(message_type). Taking a closure rather than
&mut Receiver keeps this usable with generated receiver wrappers (such as the SigV4
unwrapping receiver) that expose the same method on a different type.