docs.rs failed to build rocket-include-static-resources-0.5.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
rocket-include-static-resources-0.10.5
Include Static Resources for Rocket Framework
This is a crate which provides macros static_resources_initialize!
and static_response!
to statically include files from your Rust project and make them be the HTTP response sources quickly.
Example
extern crate lazy_static;
extern crate lazy_static_include;
extern crate rocket_include_static_resources;
extern crate rocket_etag_if_none_match;
extern crate rocket;
static_resources_initialize!;
use EtagIfNoneMatch;
use Response;
static_resources_initialize!
is used for including files into your executable binary file. You need to specify each file's ID and its path. For instance, the above example uses favicon to represent the file included-static-resources/favicon.ico and favicon_png to represent the file included-static-resources/favicon.png. An ID cannot be repeating.static_response!
is used for retrieving the file you input through the macrostatic_resources_initialize!
as a Response instance into which three HTTP headers, Content-Type, Content-Length and Etag, will be automatically added.
Refer to tests/favicon.rs
to see the example completely.
In order to reduce the compilation time, files are compiled into your executable binary file together, only when you are using the release profile.