Feature Request: Option to retrieve compressed files

50 views
Skip to first unread message

Hugues Morisset

unread,
May 12, 2026, 9:28:48 AMMay 12
to rust-embed-devs
I recently implemented a feature in include-flate that allows files to be retrieved in their compressed form (link to PR here). I think this would be a really valuable addition to rust-embed as well. Would you be open to supporting something similar?

Peter John

unread,
May 12, 2026, 10:08:19 AMMay 12
to rust-embed-devs
Hi Morisset,

Yep seems like a good addition if you don't need to decompress the data.
I guess it would be simple as just a version bump for the include-flate library?

Regards,
Peter

Hugues Morisset

unread,
May 12, 2026, 10:22:25 AMMay 12
to rust-embed-devs
Hi, 
Yes a version bump and a way to get the data compressed and the compression algorithm from `rust_embed::EmbeddedFile`.

Both are available in the IFlate struct https://github.com/SOF3/include-flate/blob/master/src/lib.rs#L148

Would you like me to send you a patch?

Regards,
Hugues

Hugues Morisset

unread,
May 12, 2026, 11:26:15 AMMay 12
to rust-embed-devs
For some reasons, I fail to clone the git repository

```
git clone https://pyrossh.dev/repos/remote-monitor.git
Cloning into 'remote-monitor'...
remote: Not Found
fatal: repository 'https://pyrossh.dev/repos/remote-monitor.git/' not found
```

Peter John

unread,
May 13, 2026, 8:03:27 AMMay 13
to rust-embed-devs
Hi Morisset,

I recently moved my website and s3 buckets to cloudflare and trying to get the git repos sorted, getting some errors even after uploading the repo. I will let you know once its fixed.

Regards,
Peter

Peter John

unread,
May 15, 2026, 4:40:51 AMMay 15
to rust-embed-devs
Hi Morisset,

I've updated the git clone url now to https://git.pyrossh.dev/rust-embed.git. Have updated on the website as well.
It seems cloudflare is having issues with HTTP/2 and git, I will file an issue with them to resolve it, but for now the git clone command needs to use HTTP/1.1 version.

GIT_CONFIG_PARAMETERS="'http.version=HTTP/1.1'" git clone https://git.pyrossh.dev/rust-embed.git

Regards,
Peter

Hugues Morisset

unread,
Jun 18, 2026, 5:11:10 AMJun 18
to rust-embed-devs
Hello, 
I've successfully implemented this, and updated the axum example.

This changes the MSRV to 1.80 to support more things in const context.
You can also choose compression algorithm.

Have a good day,
Hugues
0001-Add-support-to-get-files-dat-compressed.patch

Peter John

unread,
Jun 27, 2026, 9:07:26 AM (9 days ago) Jun 27
to rust-embed-devs
Hi,
Don't know why I was getting any error for the patch, maybe we have different HEAD commits.

@pyrossh
rust-embed
git(
977cfc0
)
$>
git
apply
--check
0001-Add-support-to-get-files-dat-compressed.patch
error: patch failed: Cargo.toml:10 error: Cargo.toml: patch does not apply error: patch failed: examples/axum.rs:1 error: examples/axum.rs: patch does not apply error: patch failed: impl/src/lib.rs:16 error: impl/src/lib.rs: patch does not apply error: patch failed: src/lib.rs:3 error: src/lib.rs: patch does not apply error: patch failed: tests/custom_crate_path.rs:1 error: tests/custom_crate_path.rs: patch does not apply error: patch failed: tests/path_traversal_attack.rs:14 error: tests/path_traversal_attack.rs: patch does not apply error: patch failed: utils/Cargo.toml:13 error: utils/Cargo.toml: patch does not apply error: patch failed: utils/src/lib.rs:44


I had to merge it, I've attached the updated patch with minor changes. Please review and let me know.
0001-Add-support-to-get-files-dat-compressed.patch
Message has been deleted

Hugues Morisset

unread,
Jul 4, 2026, 2:43:48 AM (yesterday) Jul 4
to rust-embed-devs
Sorry for the patch it seems my git HEAD was from six month ago for some reasons. I've reviewed and tested on your branch and everything works correctly

Look good to me

Thanks for considering theses changes,
Regards,
Hugues 
Reply all
Reply to author
Forward
0 new messages