pub async fn request_endpoint_stream<'a, T>(
json: &'a T,
endpoint: &'a Endpoint,
variant: EndpointVariant,
cb: impl FnMut(Result<String, Box<dyn Error>>),
) -> Result<(), Box<dyn Error>>where
T: Serialize,
Expand description
Send request to remote endpoint using JSON but response will be streamed.
ยงArguments
json
- the serialized contents to sendendpoint
- Endpoint enum variantvariant
- Endpoint variant enumcb
- callback function that will be called when message received. Note the differences of the function parameters.