官术网_书友最值得收藏!

Publishing

For developers to get their crate into this repository, cargo harbors a command: cargo publish. The command is actually doing more things behind the scenes: first it runs the cargo package to create a *.crate file that contains everything that is uploaded. Then it verifies the contents of the package by essentially running cargo test and checks whether there are any uncommitted files in the local repository. Only if these checks pass does cargo upload the contents of the *.crate file to the repository. This requires a valid account on crates.io (available with your GitHub login) to acquire your personal secret API token, and the crate has to follow certain rules.

With the previously-mentioned Wasm target, it's even possible to publish Rust packages to the famous JavaScript package repository: npm Keep in mind that Wasm support is still very new, but once a crate compiles to Wasm it can be packed into an npm package using Wasm-pack: https://github.com/rustwasm/wasm-pack.

crates.io aspires to be a permanent storage for Rust crates, so there is no "unpublish" button. Versions can be yanked with cargo yank, but this won't delete any code; it will just prohibit updates to this particular version. Additionally there can be team structures, colorful READMEs, badges, and so on, on your repository's site and we highly recommend you check out the docs on that as well: https://doc.rust-lang.org/cargo/reference/publishing.html.

主站蜘蛛池模板: 蕉岭县| 广东省| 新蔡县| 剑川县| 宾川县| 上饶县| 同江市| 侯马市| 新安县| 梁山县| 建湖县| 永宁县| 灵川县| 集贤县| 定结县| 新野县| 阿克| 叙永县| 东阿县| 宁陕县| 抚州市| 安西县| 普陀区| 大竹县| 奇台县| 鸡西市| 昆山市| 微山县| 河南省| 象州县| 巴青县| 天祝| 财经| 咸阳市| 涞源县| 奉新县| 车致| 治多县| 无极县| 漠河县| 阿克|