Macro include_url

Source
include_url!() { /* proc-macro */ }
Expand description

A procedural macro that includes content from a URL as a static string at compile time.

§Usage

use include_url_macro::include_url;

const STATIC_CONTENT: &str = include_url!("https://example.com/static/content.txt");

§Errors

This macro will fail at compile time if:

  • The URL is invalid
  • The URL scheme is not HTTP or HTTPS
  • The content cannot be fetched
  • The response is not valid UTF-8