Skip to main content

export

Function export 

Source
async fn export<R: Message + Default, T: Message>(
    ingest: &Ingest<R>,
    headers: &HeaderMap,
    body: Bytes,
    max: usize,
    ok: T,
    from_json: fn(&Yaml) -> Result<R, String>,
) -> Response
Expand description

Decode, submit, and answer. Generic over the signal because the three endpoints differ only in which types they name.

The response is echoed back in the request’s own encoding, which the spec requires: a JSON client gets {}, not a protobuf empty message that its parser will choke on.