~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git

rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.


e74a7905 pyros2097

8 years ago
Improve docs
Files changed (1) hide show
  1. README.md +5 -2
README.md CHANGED
@@ -41,8 +41,11 @@ cargo install rust-embed
41
41
  It exposes a function to serve all files stored in your assets folder which is useful for webservers. So now you can statically compile all your assets i.e. your /static/ or /public/ folders into the rust executable and serve them. So now you don't need to package your assets with your executable.
42
42
 
43
43
  ```rust
44
- assets::get(path: str)
44
+ assets::get(path: str) -> Result<&[u8], &str>
45
- // This will return the data for the file specified by the file path or will throw an error if it cannot be found.
45
+ // This will return the data for the file specified by the file path or an error if it cannot be found.
46
+
47
+ assets::list() -> Vec<&'static str>
48
+ // This will return the list of all files which were included
46
49
  ```
47
50
 
48
51
  ## Examples