How to embed resources in Rust executable?

后端 未结 2 1720
心在旅途
心在旅途 2020-12-06 00:37

This is the cousin of this question over here asking the same thing for C.

Basically, is there a better way than to just turn it into a giant byte array and putting

相关标签:
2条回答
  • 2020-12-06 01:06

    You could alternatively use this tool https://github.com/pyros2097/rust-embed Which was created by me which generates rust code for your resources.

    0 讨论(0)
  • 2020-12-06 01:22

    You probably want include_bytes!.

    If you are in older versions of Rust, use include_bin! instead.

    0 讨论(0)
提交回复
热议问题