Skip to main content

write_with_injections

Function write_with_injections 

Source
async fn write_with_injections(
    send: &mut SendStream,
    data: &[u8],
    split: Option<usize>,
    injections: &mut VecDeque<Bytes>,
) -> Result<(), TransportError>
Expand description

Write one forwarded chunk with any held injections spliced in at split.

split is the offset within data at which the destination stream is between messages; None means it is not, so the chunk goes out whole and the injections keep waiting. Injections are written in the order they were requested, and each is written verbatim: the control plane’s contract is that they are already framed.