Trait TemplateGenerator

Source
pub trait TemplateGenerator {
    // Required method
    fn generate_from_api(
        http_client: &impl HttpClient,
        endpoint_uri: &str,
        template_names: &[String],
    ) -> Result<String, ProgramExit>;
}
Expand description

Template generator trait to generate a template via an API call made over HTTP.

Required Methods§

Source

fn generate_from_api( http_client: &impl HttpClient, endpoint_uri: &str, template_names: &[String], ) -> Result<String, ProgramExit>

Generates a string template matching given template names.

The template is generated via a GET API call made over HTTP using the given http client.

§Arguments
  • http_client - The http client to be used to make the API call.
  • template_names - The template names to be used to generated the actual template
§Returns

A result containing the generated template on success, or a ProgramExit on error (e.g. 4xx, network issues…).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§