-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using assets in a crate #11683
Comments
You can include files in the crate package - see the let path_to_crate= env!("CARGO_MANIFEST_DIR"); Note that crates.io has a 10MB limit on the |
Thank you ! that's exactly what I needed ❤ |
Note that that doesn't help with |
If i understand the doc correctly, an assets/ folder at the root of the crate that is not in the gitignore would be included by default ? |
I believe so. You can also use |
This is great, thanks! Did you verify if this technique works? I think we can close the issue if so. |
Yes ! I made this crate using this technique that was perfect for my needs https://github.com/Inspirateur/twemoji-rs |
Problem
I'm writing a crate for crates.io that needs to use assets and none of these solutions satisfy me:
That seemed like a simple need but after hours of searching I still couldn't find anything except this post https://stackoverflow.com/questions/74606543/ship-tera-templates-in-a-crate-without-embedding-them-into-the-binary
with 0 replies.
Proposed Solution
If there is any way to achieve that it would be nice to have it clearly documented somewhere (I couldn't find anything about it in the cargo book either). If there is not, it would be great to add a way for my crate to use its own assets, or explain somewhere why this is not possible/desirable.
Notes
No response
The text was updated successfully, but these errors were encountered: