Function request_endpoint

Source
pub async fn request_endpoint<'a, T, F>(
    json: &'a T,
    endpoint: &'a Endpoint,
    variant: EndpointVariant,
    cb: F,
) -> Result<(), Box<dyn Error>>
where T: Serialize, F: FnMut(Result<String, Box<dyn Error>>),
Expand description

Send request to remote endpoint using JSON.

ยงArguments

  • json - the serialized contents to send
  • endpoint - Endpoint enum variant
  • variant - Endpoint variant enum
  • cb - callback function that will be called when message received.